/* =========================================================
   CLUBHOUSE V1 — View-specific Styles
   Patterns mirror the Events CRM views.css — same class
   names wherever possible so CSS is interchangeable.
   ========================================================= */

/* ---------------------------------------------------------
   View Header — used at top of every view
   --------------------------------------------------------- */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.view-header h1 {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
}

.view-header .view-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.view-export-slot {
  display: inline-flex;
  align-items: center;
}

.view-export-slot:empty {
  display: none;
}

@media (max-width: 768px) {
  .view-header h1 { font-size: var(--fs-xl); }
}

/* ---------------------------------------------------------
   Toolbar + Filter Pills
   --------------------------------------------------------- */
.toolbar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-5);
}

.toolbar--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}

.toolbar__search {
  flex: 1;
  min-width: 0;
}

.filter-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-pill {
  appearance: none;
  border: none;
  background: var(--color-hover);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  padding: 6px 14px;
  border-radius: var(--radius-pill-tight);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  line-height: 1.4;
}

.filter-pill:hover {
  background: var(--color-pressed);
}

.filter-pill.is-active {
  background: var(--fb-blue);
  color: #fff;
}

.filter-pill.is-active:hover {
  background: var(--fb-blue-hover);
}

/* Sizes — toggle chips in the Edit sizes form. Multi-select (several can
   be on at once) and thumb-sized: a min 36px hit area, wrapping rows. */
.size-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.size-chip {
  min-height: 36px;
  padding: 6px 14px;
}

/* ---------------------------------------------------------
   Dashboard — Segment 6
   --------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* ---------------------------------------------------------
   Guest List — Segment 4
   --------------------------------------------------------- */
.guest-list {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.guest-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider-soft);
  transition: background 0.1s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.guest-row:last-child {
  border-bottom: none;
}

.guest-row:hover {
  background: var(--color-surface-2);
  text-decoration: none;
}

.guest-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--fb-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  overflow: hidden;
}

.guest-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guest-row__main {
  min-width: 0;
}

.guest-row__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guest-row__sub {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.guest-row__waiver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill-tight);
  background: #fde7eb;
  color: #c01a35;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  border: 1px solid #f5b8c2;
}

.guest-row__waiver .icon {
  color: #c01a35;
  width: 14px;
  height: 14px;
}

.guest-row__waiver.is-signed {
  background: #1a7f4b;
  color: #ffffff;
  border-color: #1a7f4b;
}

.guest-row__waiver.is-signed .icon {
  color: #ffffff;
}

.guest-row__waiver-label {
  line-height: 1;
}

.guest-list__footer {
  padding: var(--space-4);
  text-align: center;
  border-top: 1px solid var(--color-divider-soft);
}

.guest-list__empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-secondary);
}

/* ---------------------------------------------------------
   Guest Search Results (inline under search bar)
   --------------------------------------------------------- */
.guest-search-wrap {
  position: relative;
  flex: 1;
}

.guest-search-results {
  margin-bottom: var(--space-4);
}

.guest-search-results__card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.guest-search-results__footer {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

/* ---------------------------------------------------------
   Leaderboards — Guests page discovery
   --------------------------------------------------------- */
.leaderboard-section {
  margin-top: var(--space-2);
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.leaderboard-card {
  margin-bottom: 0;
}

.leaderboard-card__body {
  padding: 0;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-divider-soft);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s ease;
  cursor: pointer;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-row:hover {
  background: var(--color-surface-2);
  text-decoration: none;
}

.leaderboard-row.is-first {
  background: linear-gradient(90deg, rgba(247, 185, 40, 0.16), rgba(247, 185, 40, 0.04));
}

.leaderboard-row.is-first:hover {
  background: linear-gradient(90deg, rgba(247, 185, 40, 0.24), rgba(247, 185, 40, 0.08));
}

.leaderboard-row__rank {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-text-secondary);
  text-align: center;
}

.leaderboard-row.is-first .leaderboard-row__rank {
  color: #946e10;
}

.leaderboard-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--fb-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  overflow: hidden;
  flex-shrink: 0;
}

.leaderboard-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-row__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row__score {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1024px) {
  .leaderboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Mobile: stack the three leaderboards into a single column */
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------
   Profile Header — matches Events CRM profile-header
   --------------------------------------------------------- */
.profile__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  padding: 0;
  margin-bottom: var(--space-3);
  cursor: pointer;
  text-decoration: none;
}

.profile__back:hover {
  color: var(--fb-blue);
  text-decoration: none;
}

.profile__back .icon {
  width: 16px;
  height: 16px;
}

.profile-header {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-4);
  border-top: 3px solid var(--fb-blue);
}

.profile-header__body {
  padding: var(--space-5) var(--space-6) var(--space-5);
}

.profile-header__top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-5);
  align-items: end;
}

.profile-header__identity {
  display: flex;
  gap: var(--space-4);
  align-items: flex-end;
  min-width: 0;
}

.profile-avatar {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: var(--radius-pill);
  background: var(--fb-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: var(--fw-bold);
  border: 4px solid var(--color-surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  margin-top: 0;
  overflow: hidden;
}

.profile-avatar img,
.profile-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-pill);
}

.profile-avatar--clickable {
  cursor: pointer;
}

.profile-avatar__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 6px 0;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(15, 79, 168, 0.85);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.profile-avatar--clickable:hover .profile-avatar__overlay {
  opacity: 1;
}

.profile-avatar__remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}

.profile-avatar--clickable:hover .profile-avatar__remove-btn {
  display: inline-flex;
}

.profile-avatar__remove-btn:hover {
  background: var(--color-danger);
}

.profile-avatar__remove-btn .icon {
  width: 14px;
  height: 14px;
  color: #fff;
}

/* Upload progress bar (avatar) */
.upload-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.upload-progress.is-active {
  opacity: 1;
}

.upload-progress__bar {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.2s ease;
}

.upload-progress--avatar {
  border-radius: var(--radius-pill);
  height: 4px;
  bottom: 8px;
  left: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.35);
}

.profile-header__title-block {
  padding-bottom: var(--space-2);
  min-width: 0;
}

.profile-header__name {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  margin: 0 0 var(--space-2);
  color: var(--color-text);
  line-height: var(--lh-tight);
}

.profile-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.profile-header__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-bottom: var(--space-2);
}

.profile-header__contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider-soft);
}

.profile-header__contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}

.profile-header__contact-item .icon {
  color: var(--color-text-tertiary);
  margin-top: 2px;
  flex-shrink: 0;
}

.profile-header__contact-item strong {
  display: block;
  color: var(--color-text);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
}

.profile-header__contact-item span {
  word-break: break-word;
}

/* ---------------------------------------------------------
   Section cards (collapsible)
   --------------------------------------------------------- */
.section {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider-soft);
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.section__head-main {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin: 0;
  color: var(--color-text);
}

.section__count {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  font-weight: var(--fw-regular);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section__toggle {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  padding: var(--space-1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: transform 150ms ease;
}

.section__toggle:hover {
  background: var(--color-hover);
}

.section.is-open .section__toggle {
  transform: rotate(180deg);
}

.section__body {
  padding: var(--space-3) var(--space-5) var(--space-5);
}

.section.is-collapsed .section__head {
  border-bottom: none;
}

.section.is-collapsed .section__body {
  display: none;
}

/* ---------------------------------------------------------
   Baseball Card (always-on stats section)
   --------------------------------------------------------- */
.baseball-card-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--space-5) * -1) calc(var(--space-5) * -1);
  padding: 0;
}

.baseball-card {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.baseball-card th,
.baseball-card td {
  text-align: right;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider-soft);
  white-space: nowrap;
}

.baseball-card th:first-child,
.baseball-card td:first-child {
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.baseball-card thead th {
  background: var(--color-hover);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--color-divider);
}

/* Zebra striping — skip the career row so it stays distinct */
.baseball-card tbody tr:nth-child(even):not(.is-career) {
  background: var(--color-surface-2);
}

.baseball-card tbody tr.is-career {
  background: var(--color-hover);
  font-weight: var(--fw-bold);
  border-top: 2px solid var(--color-divider);
}

.baseball-card tbody tr.is-career td {
  color: var(--color-text);
}

/* ---------------------------------------------------------
   Preferences grid — mini cards, Facebook-style
   --------------------------------------------------------- */
.preferences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}

.pref-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-divider-soft);
}

.pref-card__label {
  font-size: var(--fs-xs);
  color: var(--color-text-tertiary);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.pref-card__value {
  font-size: var(--fs-md);
  color: var(--color-text);
  font-weight: var(--fw-medium);
  word-break: break-word;
}

/* ---------------------------------------------------------
   Detail lists (Contact & Compliance, Preferences, etc.)
   --------------------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3) var(--space-5);
}

.detail-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--color-divider-soft);
  font-size: var(--fs-sm);
}

.detail-item:last-child { border-bottom: none; }

.detail-item__label {
  color: var(--color-text-secondary);
  font-weight: var(--fw-medium);
}

.detail-item__value {
  color: var(--color-text);
  word-break: break-word;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider-soft);
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.detail-list li:last-child { border-bottom: none; }

.detail-list__label {
  font-size: var(--fs-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: var(--space-2);
}

.detail-subhead {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: var(--space-4) 0 var(--space-2);
}

.detail-subhead:first-child { margin-top: 0; }

/* Notes list */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.note-item {
  padding: var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--fb-blue);
}

.note-item__meta {
  display: flex;
  gap: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.note-item__author {
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.note-item__text {
  font-size: var(--fs-sm);
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-row {
  padding: var(--space-4) 0;
  color: var(--color-text-tertiary);
  font-size: var(--fs-sm);
  text-align: center;
  font-style: italic;
}

/* ---------------------------------------------------------
   Mobile Responsiveness
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .profile-avatar {
    width: 80px;
    height: 80px;
    margin-top: 0;
    font-size: 24px;
    border-width: 3px;
  }
  .profile-header__name { font-size: var(--fs-2xl); }
  .profile-header__body { padding: var(--space-4); }
  .profile-header__top {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .profile-header__actions { justify-content: flex-start; }
  .section__head {
    padding: var(--space-3) var(--space-4);
  }
  .section__body {
    padding: var(--space-3) var(--space-4) var(--space-4);
  }
  .baseball-card-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--space-4) * -1) calc(var(--space-4) * -1);
  }
  .baseball-card th,
  .baseball-card td {
    padding: var(--space-2) var(--space-3);
  }
  .detail-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .detail-item__label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .guest-row {
    grid-template-columns: 36px 1fr;
    grid-template-areas:
      "avatar main"
      "waiver waiver";
    row-gap: var(--space-2);
  }
  .guest-row__avatar { grid-area: avatar; }
  .guest-row__main { grid-area: main; }
  .guest-row__waiver { grid-area: waiver; justify-self: start; }
}

/* ---------------------------------------------------------
   Hunts — Segment 5
   --------------------------------------------------------- */

/* Tabs */
.hunts-tabs { margin-bottom: var(--space-4); }
/* The tab row sits in the toolbar, whose own spacing holds it. The Log
   intake tab carries the count of sheets waiting for review. */
.toolbar .hunts-tabs { margin-bottom: 0; }
/* The Hunts toolbar (the tabs, the waterfowl views, Pending Shipments, the
   season) wraps its groups whole on a phone instead of squeezing each into
   a column — the season picker used to sit past the screen's edge. */
.hunts-toolbar { flex-wrap: wrap; }
.hunts-toolbar .filter-pill { white-space: nowrap; }
.hunts-toolbar__group { margin-left: var(--space-3); }
@media (max-width: 768px) {
  .hunts-toolbar__group { margin-left: 0; }
}
.hunts-tabs__intake { display: inline-flex; align-items: center; gap: var(--space-1); }
.hunts-tabs__intake .badge { padding: 1px 7px; }
.filter-pill.is-active .intake-pending-badge { background: #fff; color: var(--fb-blue); }

/* Season selector in toolbar */
.hunt-season-select { max-width: 160px; }

/* Table wrapper */
.hunt-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* A Hunts table wider than its card (a phone, an upright iPad beside the
   sidebar) scrolls sideways inside the card, where #view-root used to clip
   its right-hand columns out of reach. Each row's actions cell stays on the
   card's right edge on the surface colour while the columns scroll under
   it, so Edit (and the Hunting Log's View) is always in reach. The scroll
   shows: a thin scrollbar that stays visible where the browser draws one,
   and — for iOS, which draws none until a finger is already scrolling — a
   shadow along the actions cell and the "Scroll sideways" line the page
   shows while the table does not fit (.hunt-table-wrap.is-sideways). */
.hunt-table-card {
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hunt-table-card::-webkit-scrollbar { height: 8px; }
.hunt-table-card::-webkit-scrollbar-thumb { background: var(--color-divider); border-radius: 4px; }
.hunt-table-card::-webkit-scrollbar-track { background: var(--color-surface-2); }
@supports not selector(::-webkit-scrollbar) {
  .hunt-table-card { scrollbar-width: thin; scrollbar-color: var(--color-divider) var(--color-surface-2); }
}
.data-table .hunt-table__actions {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--color-surface);
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  text-align: right;
  white-space: nowrap;
}
.data-table thead .hunt-table__actions { background: var(--color-surface-2); }
.data-table tbody tr:hover .hunt-table__actions { background: var(--color-surface-2); }
.hunt-table-hint { display: none; margin: 0 0 var(--space-2); font-size: var(--fs-sm); color: var(--color-text-secondary); }
.hunt-table-wrap.is-sideways .hunt-table-hint { display: block; }

.hunt-table {
  min-width: 600px;
  /* Not .data-table's overflow: hidden — a clipping table would be the
     scroll container its sticky actions cell sticks to, and it never
     scrolls. The card clips the rounded corners instead. */
  overflow: visible;
}

.hunt-table__row,
.hunt-row {
  cursor: pointer;
  transition: background 0.1s ease;
}

.hunt-table__row:hover,
.hunt-row:hover {
  background: var(--color-surface-2);
}

.species-summary {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

/* Checkbox column on the Pending Shipments view */
.hunt-table__check-cell {
  width: 36px;
  text-align: center;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.hunt-table__check-cell input[type="checkbox"] {
  cursor: pointer;
}

/* Mark Shipped action bar (Pending mode only) */
.pending-action-bar .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Detail modal */
.hunt-detail-modal { max-width: 640px; }

.hunt-detail-grid {
  display: flex;
  flex-direction: column;
}

.hunt-detail-grid .detail-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--color-divider-soft);
  font-size: var(--fs-sm);
}

.hunt-detail-grid .detail-item:last-child {
  border-bottom: none;
}

.hunt-detail-photo {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-md);
  object-fit: cover;
  margin-top: var(--space-2);
}

/* Collapsible sections inside hunt detail modals */
.section--detail {
  background: transparent;
  box-shadow: none;
  border: 1px solid var(--color-divider-soft);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}
.section--detail:last-child {
  margin-bottom: 0;
}
.section--detail .section__head {
  padding: var(--space-2) var(--space-3);
}
.section--detail .section__body {
  padding: var(--space-2) var(--space-3) var(--space-3);
}
.section--detail .section__title {
  font-size: var(--fs-md);
}

/* Entry flow modal — wider than default */
.entry-flow-modal { max-width: 640px; }

/* Progress dots */
.entry-progress {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-divider-soft);
}
.entry-progress__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-divider);
  transition: background 0.15s ease;
}
.entry-progress__dot.is-active { background: var(--fb-blue); }
.entry-progress__dot.is-done  { background: var(--color-success); }

/* Card container */
.entry-card-container {
  padding: var(--space-5);
  max-height: 60vh;
  overflow-y: auto;
}
.entry-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}
.entry-card__body--scroll {
  max-height: 50vh;
  overflow-y: auto;
}

/* Back / Cancel / Next bar */
.entry-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-divider-soft);
}
.entry-nav > .btn-outline {            /* Back — left column */
  grid-column: 1;
  justify-self: start;
}
.entry-nav > .entry-cancel-btn {       /* Cancel Entry — center, less prominent */
  grid-column: 2;
  justify-self: center;
  font-size: var(--fs-sm);
  padding: 5px 12px;
  opacity: 0.85;
}
.entry-nav > .entry-cancel-btn:hover {
  opacity: 1;
}
.entry-nav > .btn-primary {            /* Next — right column */
  grid-column: 3;
  justify-self: end;
}

/* Cancel-entry confirm dialog */
.modal.entry-cancel-confirm h3 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

/* Species grid (waterfowl) */
.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-2);
}
.species-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.species-input__label { font-size: var(--fs-sm); flex: 1; }
.species-input__field {
  width: 56px;
  text-align: center;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-md);
  font-family: inherit;
  background: var(--color-surface);
}
.species-input__field:focus {
  outline: none;
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 2px rgba(24,119,242,.20);
}
.species-total {
  margin-top: var(--space-3);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  text-align: right;
  color: var(--color-text);
}

/* Guest search in entry flow */
.hunt-guest-results { max-height: 200px; overflow-y: auto; }
.hunt-guest-result {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  transition: background 0.1s ease;
}
.hunt-guest-result:hover { background: var(--color-surface-2); }
.hunt-guest-result__name { font-weight: var(--fw-semibold); }

/* Selected hunter chip */
.hunt-selected-hunter {
  background: var(--fb-blue-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hunt-selected-hunter__name {
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}
.hunt-selected-hunter__detail {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  flex: 1;
}

/* Manual-entry toggle row */
.hunt-manual-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Compliance checkbox */
.hunt-compliance__label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text);
  cursor: pointer;
}
.hunt-compliance__label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

/* Warning banner (historical record) */
.hunt-warning-banner {
  background: rgba(247,185,40,.15);
  border: 1px solid rgba(247,185,40,.4);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

/* Weather read-only display */
.hunt-weather-display,
.hunt-weather-panel {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

/* Alert styles */
.alert {
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-text);
}
.alert-warning {
  background: rgba(247,185,40,.15);
  border: 1px solid rgba(247,185,40,.4);
}

/* ---------------------------------------------------------
   Intake (log sheet upload) — #/intake list + review/sign-off
   Plain DOM (h()), no .data-table; phone rules live in the
   hunts 768px block below.
   --------------------------------------------------------- */
.badge[hidden] { display: none; }
/* The review screen toggles elements with the hidden attribute; several of
   them carry display:flex/grid rules below, which would beat the UA
   [hidden] rule, so re-assert it for everything the intake screens toggle. */
.intake-review [hidden],
.intake-upload [hidden],
.intake-list-wrap [hidden],
.intake-section [hidden],
.intake-check[hidden],
.intake-pkgmode[hidden],
.intake-guest__chip[hidden],
.intake-guest__search[hidden] { display: none !important; }

.intake-header .intake-subtitle { margin-top: var(--space-1); }

/* Upload control */
.intake-upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.intake-upload__hint {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}
.intake-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.intake-upload__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 20px;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}
.intake-upload__status.is-error { color: var(--color-danger); font-weight: var(--fw-semibold); }
.intake-upload__status.is-ok { color: var(--color-success); font-weight: var(--fw-semibold); }

/* Intake list — card rows at every width */
.intake-toolbar { margin-bottom: var(--space-3); }
.intake-toolbar .filter-pills { align-items: center; }
.intake-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.intake-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: 0 0 0 1px var(--color-divider-soft), var(--shadow-sm);
  cursor: pointer;
  transition: background 0.1s ease;
}
.intake-list__row:hover,
.intake-list__row:focus-visible { background: var(--color-surface-2); outline: none; }
.intake-list__row--static { cursor: default; box-shadow: none; background: var(--color-surface-2); }
.intake-list__main { min-width: 0; }
.intake-list__title { font-weight: var(--fw-semibold); }
.intake-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--space-3);
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}
.intake-list__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
}

/* Review screen — two panes on desktop */
.intake-review {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-4);
  align-items: start;
}
.intake-review__scan {
  position: sticky;
  top: var(--space-4);
  min-width: 0;
}
.intake-review__form { min-width: 0; }
.intake-scan__frame {
  display: block;
  width: 100%;
  height: calc(100vh - 140px);
  min-height: 420px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}
.intake-scan__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}

/* Sections */
.intake-section { margin-bottom: var(--space-4); }
.intake-section__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}
.intake-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

/* Fields */
.intake-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
}
.intake-field { min-width: 0; }
.intake-field--wide { grid-column: 1 / -1; }
.intake-field__label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}
.intake-field__value { font-size: var(--fs-md); }
.intake-field__orig {
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--color-text-tertiary);
  overflow-wrap: anywhere;
}
.intake-field__flag {
  margin-top: 2px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: #946e10;
}
.intake-field.is-flagged .input,
.intake-field.is-flagged .select {
  border-color: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(247,185,40,.22);
}
.intake-field__inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.intake-field__inline .input { flex: 1 1 96px; min-width: 0; }
.intake-field__stack { display: flex; flex-direction: column; gap: var(--space-2); }
.intake-expected {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.intake-expected.is-mismatch { color: var(--color-danger); font-weight: var(--fw-semibold); }
.intake-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}

/* Guides — thumb-sized chips, multi-select, plus Unguided */
.intake-guides { gap: var(--space-2); }
.intake-guides .filter-pill.intake-guides__chip {
  min-height: 44px;
  padding: 10px 16px;
  font-size: var(--fs-base, 15px);
}
.intake-guides__note { margin-top: var(--space-2); }

/* A hunter with no birds: a diary activity, no package */
.intake-row__nobirds {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  font-size: var(--fs-sm);
}
.intake-row__birdonly[hidden] { display: none; }
.intake-diary__note { color: var(--color-text-secondary); }
.intake-diary__note.is-warning { color: var(--color-danger); font-weight: var(--fw-semibold); }

/* Package-number choice */
.intake-pkgmode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background: rgba(247,185,40,.15);
  border: 1px solid rgba(247,185,40,.4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
}
.intake-pkgmode__text { flex: 1 1 260px; }

/* Hunter rows */
.intake-rows { display: flex; flex-direction: column; gap: var(--space-3); }
.intake-row {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-divider-soft);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.intake-row.is-needs-pick { border-color: var(--color-warning); }
.intake-row__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.intake-row__title { font-weight: var(--fw-bold); }
.intake-row__spacer { flex: 1; }
.intake-row__note {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-2);
}
.intake-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-divider);
  flex-shrink: 0;
}
.intake-dot--high { background: var(--color-success); }
.intake-dot--medium { background: var(--color-warning); }
.intake-dot--low { background: var(--color-danger); }
.intake-row__grid {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(180px, 1fr) minmax(130px, 160px);
  gap: var(--space-3) var(--space-4);
  align-items: start;
}

/* Between a phone and a wide desktop the form pane beside the scan is too
   narrow for the three-column hunter row, so stack the panes first. */
@media (max-width: 1180px) {
  .intake-review { grid-template-columns: 1fr; }
  .intake-review__scan { position: static; }
  .intake-scan__frame { height: 70vh; min-height: 360px; }
}
@media (max-width: 900px) {
  .intake-row__grid { grid-template-columns: 1fr; }
}
.intake-guest { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.intake-guest__written { font-size: var(--fs-sm); color: var(--color-text-secondary); }
.intake-guest__chip { padding: var(--space-2) var(--space-3); }
.intake-guest__search { display: flex; flex-direction: column; gap: var(--space-1); }

/* Species — 18 sheet columns, scaup under a disclosure */
.intake-species {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-1) var(--space-2);
  margin-top: var(--space-3);
}
.intake-species .species-input { padding: var(--space-1) var(--space-2); min-width: 0; }
.intake-species .species-input__label {
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.intake-species .species-input__field { width: 52px; flex-shrink: 0; }
.intake-species .species-input.is-over .species-input__field {
  border-color: var(--color-danger, #dc2626);
  box-shadow: 0 0 0 2px rgba(220,38,38,.18);
}
.intake-species__extra { margin-top: var(--space-2); }
.intake-species__extra summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  user-select: none;
}
.intake-species__extra .intake-species { margin-top: var(--space-2); }
.intake-row__total {
  margin-top: var(--space-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  text-align: right;
}
.intake-row__total.is-zero { color: var(--color-danger); }
.intake-warn {
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-danger);
  text-align: right;
}

/* Ship / banded toggles */
.intake-row__toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-divider-soft);
}
.intake-toggle { display: inline-flex; align-items: center; gap: var(--space-2); }
.intake-toggle__label { font-size: var(--fs-sm); color: var(--color-text-secondary); }
.intake-row__ship,
.intake-row__cert { margin-top: var(--space-3); }
.intake-row__recipient {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
}
.intake-row__recipient .entry-card__title {
  font-size: var(--fs-md);
  margin-bottom: var(--space-2);
}

/* Sign-off */
.intake-checklist {
  margin: 0 0 var(--space-3);
  padding-left: 18px;
  font-size: var(--fs-sm);
  color: var(--color-danger);
}
.intake-checklist li { margin: 2px 0; }
.intake-ready {
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--color-success);
}
.intake-signed { margin: 0 0 var(--space-2); }
.intake-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* ---- Hunts mobile overrides ---- */
@media (max-width: 768px) {
  .hunt-table {
    min-width: 500px;
  }
  .hunt-detail-grid .detail-item {
    grid-template-columns: 100px 1fr;
  }
  .entry-flow-modal,
  .hunt-flow-overlay .modal {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .entry-card-container { max-height: calc(100vh - 200px); }
  .species-grid { grid-template-columns: repeat(2, 1fr); }

  /* The row's actions sit over the columns scrolling under them. */
  .data-table .hunt-table__actions { box-shadow: -8px 0 8px -8px rgba(0, 0, 0, 0.35); }

  /* Sticky hunter-name column */
  .hunt-col-sticky {
    position: sticky;
    left: 0;
    background: var(--color-surface);
    z-index: 1;
  }
  .data-table thead .hunt-col-sticky {
    background: var(--color-surface-2);
  }
  .hunts-tabs { flex-wrap: wrap; }

  /* Intake (log sheet upload) — single column, no inline PDF */
  .intake-header .view-actions { width: 100%; }
  .intake-header .view-actions .btn { flex: 1 1 auto; }
  .intake-review { grid-template-columns: 1fr; }
  .intake-review__scan { position: static; }
  .intake-fields { grid-template-columns: 1fr; }
  .intake-row { padding: var(--space-3); }
  .intake-row__grid { grid-template-columns: 1fr; }
  /* One species per line: two columns leave ~37px for a label like
     "Hooded Merganser (2)" on a 390px iPhone once the sidebar rail, view,
     card and row paddings are taken out. */
  .intake-species { grid-template-columns: 1fr; }
  .intake-species .species-input__label { white-space: normal; }
  .intake-species .species-input__field { width: 64px; }
  /* iOS Safari zooms into any control under 16px; the review screen has
     ~200 of them, so keep every intake control at 16px on phones. */
  .intake-review .input,
  .intake-review .select,
  .intake-review textarea,
  .intake-review .species-input__field { font-size: 16px; }
  .intake-list__row { grid-template-columns: 1fr; }
  .intake-list__side { flex-direction: row; align-items: center; }
  .intake-pkgmode .filter-pills { width: 100%; }
  .intake-pkgmode .filter-pill { flex: 1 1 auto; text-align: center; }
  .intake-actions .btn { flex: 1 1 auto; }
  .intake-row__head .btn { margin-left: auto; }
}

/* ---------------------------------------------------------
   Visits — Segment 5
   --------------------------------------------------------- */
.visit-entry {
  /* Visit list / detail — built in Segment 5 */
}

/* ---------------------------------------------------------
   Reports — Segment 7
   --------------------------------------------------------- */
.report-tile {
  /* Report tiles — built in Segment 7 */
}

/* ---------------------------------------------------------
   Settings (#/settings): one list of sections, every one
   collapsed to its header — the title, a line saying what is
   inside, a chevron — and the open one (#/settings/<key>)
   drawn under its header. A card inside a section (the Staff
   table, Processing Centers, the backfill) sits flat in it.
   --------------------------------------------------------- */
.settings-sections { display: flex; flex-direction: column; gap: var(--space-2); }
.settings-section { padding: 0; margin-bottom: 0; overflow: hidden; }
.settings-section__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s ease;
}
.settings-section__head:hover { background: var(--color-surface-2); text-decoration: none; }
.settings-section__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.settings-section__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.settings-section__desc { font-size: var(--fs-sm); color: var(--color-text-secondary); line-height: 1.35; }
.settings-section__chevron { flex: 0 0 auto; display: inline-flex; color: var(--color-text-secondary); transition: transform 0.15s ease; }
.settings-section.is-open .settings-section__chevron { transform: rotate(90deg); }
.settings-section.is-open .settings-section__head { border-bottom: 1px solid var(--color-divider-soft); }
.settings-section__body { padding: var(--space-4) var(--space-5) var(--space-5); min-width: 0; }
.settings-section__body[hidden] { display: none; }
.settings-section__body .card { box-shadow: none; background: transparent; padding: 0; margin: 0 0 var(--space-5); border-radius: 0; }
.settings-section__body .card:last-child { margin-bottom: 0; }
.settings-version { margin: var(--space-4) 0 0; }
@media (max-width: 768px) {
  .settings-section__head { padding: var(--space-3) var(--space-4); }
  .settings-section__body { padding: var(--space-3) var(--space-4) var(--space-4); }
}

/* Jotform Sync → Needs attention: one row per skipped or errored
   submission — what it is, when, the typed name, why — with Match to
   guest (an inline guest picker) and Dismiss. */
.jf-attention { margin-top: var(--space-3); }
.jf-attention__title { font-weight: 600; font-size: 0.8rem; margin-bottom: var(--space-1); }
.jf-attention__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider-soft);
  font-size: 0.78rem;
}
.jf-attention__row.is-busy { opacity: 0.6; }
.jf-attention__line { flex: 1 1 260px; min-width: 0; color: var(--color-text-secondary); }
.jf-attention__what { font-weight: 600; color: var(--color-text); }
.jf-attention__who { color: var(--color-text); }
.jf-attention__actions { display: flex; gap: var(--space-2); flex: 0 0 auto; }
.jf-attention__match { flex: 1 1 100%; display: flex; align-items: flex-start; gap: var(--space-2); }
.jf-attention__match[hidden] { display: none; }
.jf-attention__picker { flex: 1 1 auto; min-width: 0; }

/* ---------- Dashboard (Segment 6) ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  min-width: 0;
  overflow: hidden;
}

.dash-stat-card {
  text-align: center;
  padding: 20px 12px;
}

.dash-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text, #050505);
  line-height: 1.2;
}

.dash-stat-label {
  font-size: 12px;
  color: var(--color-text-secondary, #65676b);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-col > .card {
  margin-bottom: 16px;
}

.card-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid #e4e6eb;
}

.card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #050505);
}

.dash-list {
  padding: 8px 0;
}

.dash-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.dash-list-row:hover {
  background: #f0f2f5;
}

.dash-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.dash-avatar-init {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fb-blue, #1877f2);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.dash-list-info {
  flex: 1;
  min-width: 0;
}

.dash-list-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #050505);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-list-meta {
  font-size: 12px;
  color: var(--color-text-secondary, #65676b);
}

.dash-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.badge-blue {
  background: #e7f3ff;
  color: #1877f2;
}

.badge-green {
  background: #e6f4ea;
  color: #1e8e3e;
}

.badge-orange {
  background: #fef3e2;
  color: #c5630a;
}

/* Dashboard responsive */
@media (max-width: 1024px) {
  .dash-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-stat-value {
    font-size: 22px;
  }
  .dash-stat-label {
    font-size: 11px;
  }
}

/* ---------- Recently Deleted (Segment 6) ---------- */

.deleted-toggle {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.deleted-toggle:hover,
.deleted-toggle.is-active {
  opacity: 1;
}

.deleted-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #e4e6eb;
}

.deleted-row:last-child {
  border-bottom: none;
}

.deleted-row-info {
  flex: 1;
  min-width: 0;
}

/* ---------- Settings → Maintenance (the weather backfill) ---------- */

.settings-data-maintenance {
  display: block;
}

.backfill-card {
  margin-top: 8px;
}

.backfill-card__title {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 600;
}

.backfill-card__desc {
  margin: 0 0 12px 0;
}

.backfill-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Backfill progress overlay ---------- */

.backfill-progress .modal-body {
  padding: 16px 20px 20px 20px;
}

.backfill-progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: var(--color-surface-2, #eef0f3);
  border-radius: 999px;
  overflow: hidden;
}

.backfill-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2e7d32, #4caf50);
  transition: width 0.2s ease;
}

.backfill-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.backfill-counter {
  background: var(--color-surface-2, #f5f5f5);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.backfill-counter__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary, #666);
  margin-bottom: 2px;
}

.backfill-counter__value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.backfill-counter--updated .backfill-counter__value { color: #2e7d32; }
.backfill-counter--skipped .backfill-counter__value { color: #b45309; }
.backfill-counter--errors  .backfill-counter__value { color: #b91c1c; }

.backfill-log {
  margin: 4px 0 0 0;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------------------------------------------------
   vCard Importer Modal
   --------------------------------------------------------- */
.vcard-import-modal {
  max-width: 800px;
  width: 100%;
}

@media (max-width: 768px) {
  .vcard-import-modal {
    max-width: 100%;
  }
}

.vcard-dropzone {
  border: 2px dashed var(--color-border, #cbd5e1);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  background: var(--color-surface-2, #f8fafc);
}

.vcard-dropzone:hover,
.vcard-dropzone:focus,
.vcard-dropzone.is-dragging {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  outline: none;
}

.vcard-dropzone__title {
  font-weight: 600;
  margin-bottom: 6px;
}

.vcard-review-body {
  max-height: 60vh;
  overflow-y: auto;
}

.vcard-section {
  margin-bottom: 16px;
}

.vcard-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--color-divider-soft, #e5e7eb);
  margin-bottom: 4px;
}

.vcard-row-list {
  display: flex;
  flex-direction: column;
}

.vcard-row {
  padding: 8px 4px;
  border-bottom: 1px solid var(--color-divider-soft, #f1f5f9);
}

.vcard-row__main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vcard-row__check {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.vcard-row__body {
  flex: 1;
  min-width: 0;
}

.vcard-row__name {
  font-weight: 600;
}

.vcard-row__match {
  font-size: 0.85rem;
}

.vcard-conf--exact {
  color: var(--color-success, #16a34a);
}

.vcard-conf--fuzzy {
  color: var(--color-warning, #b45309);
}

.vcard-conf--ambiguous {
  color: var(--color-danger, #dc2626);
}

.vcard-row__detail {
  margin-left: 32px;
  margin-top: 2px;
}

.vcard-row__status {
  width: auto;
  margin-left: auto;
}

.vcard-footer {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.vcard-footer__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.vcard-summary {
  flex: 1;
  min-width: 200px;
}

.vcard-privacy-statement {
  font-style: italic;
  color: var(--color-text-secondary, #64748b);
  font-size: 0.875rem;
  background: var(--color-surface-2, #f8fafc);
  border-left: 3px solid var(--color-border, #cbd5e1);
  padding: 10px 12px;
  margin: 0 0 16px 0;
  border-radius: 4px;
}

.vcard-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .vcard-mode-grid {
    grid-template-columns: 1fr;
  }
}

.vcard-mode-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.vcard-mode-option .btn {
  width: 100%;
}

.vcard-mode-subtitle {
  margin: 0;
}


/* ---------- Read-layer audit fixes (2026-09-02) ---------- */

/* Guests: leaderboard period picker */
.leaderboard-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.leaderboard-toolbar .label { margin: 0; }

/* Guest profile: unlinked-entries warning above the Hunting Stats table */
.baseball-card__warning {
  font-size: var(--fs-sm);
  color: var(--color-warning-text, #8a5a00);
  background: var(--color-warning-bg, #fff6e0);
  border: 1px solid var(--color-warning, #e0a800);
  border-radius: 8px;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

/* Guest profile: what the Processing days column counts, under the table.
   .baseball-card-wrap above it carries a negative bottom margin (the
   full-bleed scroll wrapper), which swallowed the old --space-2 and left
   the note flush against the Career row; the margin here nets out to a
   real gap, and the hairline marks it as a footnote, not another row. */
.baseball-card__note {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  margin-top: calc(var(--space-5) + var(--space-4));
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider-soft);
  line-height: var(--lh-normal);
}

/* Dashboard: Recent Harvests rows without a guest link are not clickable */
.dash-list-row.is-static { cursor: default; }

/* Log intake: read-confidence text beside the dot (medium / low only) */
.intake-confidence {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.intake-confidence--low { color: var(--color-danger); font-weight: 600; }
.intake-confidence--medium { color: var(--color-warning-text, #8a5a00); }

/* Hunts: deleted-record banner in the detail modals */
.hunt-detail-deleted {
  font-size: var(--fs-sm);
  color: var(--color-danger);
  background: rgba(220, 53, 69, 0.08);
  border-radius: 8px;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

/* Log intake: row total disagrees with the sheet's own Total column */
.intake-row__total.is-mismatch {
  color: var(--color-danger);
  font-weight: 600;
}

/* ---------------------------------------------------------
   Hunt Log (profile) and hunt-report rows on the Hunts page
   --------------------------------------------------------- */
.huntlog-pager {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.huntlog-pager__label {
  font-weight: var(--fw-semibold);
  min-width: 5em;
  text-align: center;
}
.huntlog-list { display: flex; flex-direction: column; gap: var(--space-2); }
.huntlog-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-divider-soft, #eee);
  border-radius: var(--radius-sm, 8px);
  background: var(--color-surface, #fff);
}
.huntlog-row__main { flex: 1; min-width: 0; }
.huntlog-row__title { margin-bottom: 2px; }
.huntlog-row__meta { font-size: var(--fs-sm); color: var(--color-text-secondary); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.huntlog-row__notes { margin-top: var(--space-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.huntlog-row__photos { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.huntlog-row__photos img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--color-divider-soft, #eee);
  display: block;
}
.huntlog-row__actions { flex-shrink: 0; display: flex; flex-direction: column; gap: var(--space-2); }
/* The hunt editor's Photos block: existing and pending thumbnails, each with a × */
.huntlog-photos { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.huntlog-photo { position: relative; width: 72px; height: 72px; }
.huntlog-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--color-divider-soft, #eee);
}
.huntlog-photo.is-pending img { outline: 2px dashed var(--color-text-secondary, #888); outline-offset: -2px; }
.huntlog-photo__remove {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--color-divider, #ccc);
  background: var(--color-surface, #fff);
  color: var(--color-text, #222);
  font-size: 16px; line-height: 22px; text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.huntlog-photo__remove:disabled { opacity: 0.5; cursor: default; }
.huntlog-photos__empty { margin-top: var(--space-1); }
.huntlog-form__row { display: flex; gap: var(--space-3); }
.huntlog-form__row > * { flex: 1; min-width: 0; }
.huntlog-form__field { margin-bottom: var(--space-3); }
.huntlog-stepper {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.huntlog-stepper__label { flex: 1; }
.huntlog-stepper__value { min-width: 2em; text-align: center; font-weight: var(--fw-semibold); }
.huntlog-stepper .btn { min-width: 40px; min-height: 36px; }
.huntlog-warnings {
  background: var(--color-warning-soft, #fff4d6);
  color: #946e10;
  border-radius: var(--radius-sm, 8px);
  padding: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
}
.hunt-details-needed-line {
  font-size: var(--fs-sm);
  color: #946e10;
  background: var(--color-warning-soft, #fff4d6);
  border-radius: var(--radius-sm, 8px);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.hunt-detail-banner {
  font-size: var(--fs-sm);
  color: #946e10;
  background: var(--color-warning-soft, #fff4d6);
  border-radius: var(--radius-sm, 8px);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.hunts-report-note { font-size: var(--fs-sm); color: var(--color-text-secondary); margin: var(--space-2) 0 var(--space-3); }

/* ---- New hunt (deer & turkey) and the meat-room number ---- */
/* A slide's one-line explanation under its title. */
.hunt-card-hint { font-size: var(--fs-sm); color: var(--color-text-secondary); margin: 0 0 var(--space-3); }
/* What did you see: − [count] + per animal, blank until touched. */
.hunt-seen { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.hunt-seen__label { flex: 1; font-weight: var(--fw-semibold); }
.hunt-seen__btn { min-width: 44px; min-height: 44px; padding: 0; font-size: var(--fs-lg); }
.hunt-seen__input { width: 72px; text-align: center; font-size: var(--fs-lg); }
/* What happened and Were you successful: finger-sized pills. */
.hunt-happened .filter-pill,
.hunt-success .filter-pill { padding: 10px 18px; font-size: var(--fs-md, 15px); }
.hunt-success .filter-pill { min-width: 96px; }
.hunt-review__head { margin: var(--space-4) 0 var(--space-2); font-size: var(--fs-sm); color: var(--color-text-secondary); }
.hunt-review__animal,
.hunt-review__notes {
  padding: var(--space-2);
  background: var(--color-bg-subtle, #f3f4f6);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
  font-size: var(--fs-sm);
}
/* After the save: the zip-tie number, big enough to copy from across the room. */
.hunt-done { text-align: center; }
.hunt-done__number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: var(--fw-bold);
  line-height: 1.1;
  margin: var(--space-2) 0 var(--space-2);
}
.hunt-done__warn {
  font-size: var(--fs-sm);
  color: #946e10;
  background: var(--color-warning-soft, #fff4d6);
  border-radius: var(--radius-sm, 8px);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
  text-align: left;
}
/* The Deer and Turkey tables' "#" column: the number, or Arrived. */
.data-table .hunt-table__num { white-space: nowrap; font-weight: var(--fw-bold); }
.hunt-arrived-btn { white-space: nowrap; }
/* The detail's and the edit flow's number line. */
.hunt-meat-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.modal > .hunt-meat-bar { margin: 0; border-radius: 0; padding: var(--space-2) var(--space-5); }
.hunt-meat-bar__label { color: var(--color-text-secondary); }
.hunt-meat-bar__num { font-size: var(--fs-lg); }
/* The profile's Hunt Log row: "#7" beside a harvested deer or turkey. */
.huntlog-row__num { font-weight: var(--fw-bold); white-space: nowrap; }
/* The profile's Add hunt: which animal. */
.hunt-add-choices { display: flex; flex-direction: column; gap: var(--space-2); }
.hunt-add-choice { width: 100%; min-height: 44px; font-size: var(--fs-md, 15px); }

/* ---------------------------------------------------------
   Waterfowl leaderboard — tabbed card (Guests page), 2026-09-27
   --------------------------------------------------------- */
.leaderboard-card--waterfowl .section__head { cursor: default; }
/* Desktop: the waterfowl card takes two columns with deer and turkey
   stacked beside it, so seven columns of names and numbers have room. */
.leaderboard-card--waterfowl {
  grid-column: span 2;
  grid-row: span 2;
  align-self: start;
}
@media (max-width: 1024px) {
  .leaderboard-card--waterfowl { grid-row: auto; }
}
@media (max-width: 768px) {
  .leaderboard-card--waterfowl { grid-column: auto; }
}
.wf-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.wf-tabs {
  padding: var(--space-3) var(--space-5) var(--space-2);
}
.wf-note {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  padding: 0 var(--space-5) var(--space-2);
}
.wf-head {
  display: grid;
  grid-template-columns: 1fr 44px 40px 44px 48px;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-5);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  text-align: right;
  border-bottom: 1px solid var(--color-divider-soft);
}
.leaderboard-row--wf {
  grid-template-columns: 28px 36px 1fr 44px 40px 44px 48px;
  gap: var(--space-2);
}
.leaderboard-row--wf .leaderboard-row__score { text-align: right; }
.wf-stat {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.leaderboard-card--waterfowl .empty-row { padding: var(--space-4) var(--space-5); }
@media (max-width: 480px) {
  /* Narrow phones: only Birds and Limits. */
  .wf-col--days, .wf-col--drakes { display: none; }
  .wf-head { grid-template-columns: 1fr 44px 44px; }
  .leaderboard-row--wf { grid-template-columns: 28px 36px 1fr 44px 44px; }
}

/* Edit Profile: small muted help under a field */
.field-help {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

/* ---------------------------------------------------------
   Waterfowl leaderboard — TV screen (#/leaderboard-tv), 16:9
   Bone #EAE3D5 with the logo's brown #52382D for all text (a brown
   background washed out the brown logo); sizes in vh so 11 rows always fit.
   --------------------------------------------------------- */
.tv-screen {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 2.5vh 4vw;
  background: #EAE3D5;
  color: #52382D;
  font-family: Georgia, "Times New Roman", serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tv-screen.is-idle { cursor: none; }
.tv-exit {
  position: absolute;
  top: 2vh;
  right: 2vw;
  z-index: 2;
  background: transparent;
  color: #52382D;
  border: 1px solid rgba(82, 56, 45, 0.55);
  border-radius: 8px;
  font: inherit;
  font-size: 2.2vh;
  padding: 1vh 2.2vh;
  cursor: pointer;
  opacity: 1;
  transition: opacity 200ms ease;
}
.tv-screen.is-idle .tv-exit { opacity: 0; pointer-events: none; }
.tv-header {
  display: flex;
  align-items: center;
  gap: 2.5vw;
  flex: 0 0 auto;
  padding-bottom: 1.5vh;
  border-bottom: 2px solid rgba(82, 56, 45, 0.35);
}
.tv-logo { height: 10vh; width: auto; display: block; }
.tv-header-main { flex: 1 1 auto; min-width: 0; text-align: center; }
.tv-title {
  font-size: 5.2vh;
  font-weight: bold;
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.tv-header-side {
  text-align: right;
  font-family: var(--font-sans);
  font-size: 2.4vh;
  opacity: 0.9;
  flex: 0 0 auto;
  padding-right: 8vw;
}
.tv-failed { color: #A5462C; min-height: 1.2em; }
.tv-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 1.5vh;
}
.tv-board-title {
  font-size: 3.4vh;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 0.8vh;
}
.tv-head, .tv-row {
  display: grid;
  grid-template-columns: 7vw 1fr 14vw 12vw 12vw;
  align-items: baseline;
  column-gap: 2vw;
  padding: 0 1.5vw;
}
.tv-head {
  font-family: var(--font-sans);
  font-size: 2.1vh;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  text-align: right;
  padding-bottom: 0.5vh;
}
.tv-rows {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tv-row {
  box-sizing: border-box;
  height: 6vh;
  border-bottom: 1px solid rgba(82, 56, 45, 0.18);
}
.tv-row.is-first { background: rgba(82, 56, 45, 0.1); border-radius: 6px; }
.tv-rank { font-size: 3.4vh; font-weight: bold; opacity: 0.85; }
.tv-name {
  font-size: 4vh;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-birds {
  font-size: 4.6vh;
  font-weight: bold;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tv-limits, .tv-days {
  font-size: 3.2vh;
  text-align: right;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.tv-empty { font-size: 3.6vh; opacity: 0.8; padding: 6vh 0; text-align: center; }
/* The pending-wrap-up footnote under the rows: a count, never a filter. */
.tv-pending { font-family: var(--font-sans); font-size: 2vh; letter-spacing: 0.04em; opacity: 0.75; text-align: center; padding-top: 0.8vh; flex: 0 0 auto; }
.tv-dots {
  display: flex;
  justify-content: center;
  gap: 1.6vh;
  padding-top: 1.5vh;
  flex: 0 0 auto;
}
.tv-dot {
  width: 1.6vh;
  height: 1.6vh;
  border-radius: 50%;
  background: rgba(82, 56, 45, 0.3);
}
.tv-dot.is-active { background: #52382D; }
.tv-dot.is-empty { opacity: 0.35; }

/* ---------------------------------------------------------
   Events (#/events) — the list cards, the editor and its attendees
   --------------------------------------------------------- */
.events-group { margin-bottom: var(--space-6); }
.events-group__title {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}
.event-card {
  display: block;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s ease;
}
.event-card:hover { background: var(--color-surface-2); text-decoration: none; }
.event-card__name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  margin-bottom: 2px;
}
.event-card__brand { font-size: 10px; padding: 2px 8px; }
.event-card__dates { font-size: var(--fs-sm); color: var(--color-text); }
.event-card__meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}
.events-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-secondary);
}
.events-empty--inline { padding: var(--space-5) var(--space-4); }

/* The editor: two columns of label + control, one on a phone. */
.event-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-4);
}
.event-form .form-group { margin-bottom: 0; }
.event-form__field--full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .event-form { grid-template-columns: 1fr; }
}
.event-editor__error { min-height: 1.2em; margin-top: var(--space-3); font-size: var(--fs-sm); }
.event-editor__error:empty { display: none; }
.event-editor__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.event-editor__revised { margin-left: auto; font-size: var(--fs-xs); color: var(--color-text-secondary); }

/* Attendees: the picker row, the table of inputs, the counts line. */
.event-attendees__add {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.event-attendees__picker { flex: 1 1 auto; min-width: 0; }
.event-attendees__add .btn { flex: 0 0 auto; white-space: nowrap; }
.event-attendees__table-wrap { overflow-x: auto; }
.event-attendees__table .input {
  min-width: 120px;
  padding: 6px var(--space-2);
  font-size: var(--fs-sm);
}
.event-attendees__table input[type="date"].input { min-width: 140px; }
.event-attendees__name { white-space: nowrap; font-weight: var(--fw-semibold); }
.event-attendees__child { margin-left: var(--space-1); }
.event-attendees__actions { white-space: nowrap; text-align: right; }
.event-attendees__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 20px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: var(--radius-md);
}
.event-attendees__remove:hover { color: var(--color-danger); background: var(--color-hover); }
.events-saved-flash {
  display: inline-block;
  min-width: 3em;
  margin-right: var(--space-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-success);
  opacity: 0;
  transition: opacity 200ms ease;
}
.events-saved-flash.is-visible { opacity: 1; }
.event-attendees__counts {
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

/* Findings: the strip under the header card — warnings first, then notes,
   each a sentence that scrolls to the row it names. */
.event-findings {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.event-finding {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-divider);
  border-left: 4px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.4;
  cursor: pointer;
}
.event-finding:hover { background: var(--color-surface-2); }
.event-finding--warning { border-left-color: var(--color-warning); background: var(--color-warning-soft); }
.event-finding--warning:hover { background: var(--color-warning-soft); filter: brightness(0.98); }
.event-finding--note { border-left-color: var(--color-divider); }
.event-finding__kind {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}
.event-finding--warning .event-finding__kind { color: #946e10; }
.event-warn-badge { margin-left: var(--space-2); font-size: 10px; padding: 1px 7px; vertical-align: middle; }
.event-warn-badge[hidden] { display: none; }

/* A row a finding points at, for a moment. */
.is-highlighted { animation: event-highlight 1.6s ease-out; }
@keyframes event-highlight {
  0% { background-color: var(--color-warning-soft); box-shadow: 0 0 0 3px var(--color-warning-soft); }
  100% { background-color: transparent; box-shadow: none; }
}

/* Itinerary and Meals: one block per day. */
.event-day { margin-bottom: var(--space-5); }
.event-day:last-child { margin-bottom: 0; }
.event-day__title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}
.event-day__outside { text-transform: none; letter-spacing: 0; font-weight: var(--fw-medium); }
.event-day__empty { font-size: var(--fs-sm); padding: var(--space-2) 0; }
.event-day__add { margin-top: var(--space-2); }
.event-itinerary__table { width: 100%; }
.event-itinerary__table td { vertical-align: middle; }
.event-itinerary__times { white-space: nowrap; }
.event-itinerary__times .input { width: 118px; min-width: 0; display: inline-block; padding: 6px var(--space-2); font-size: var(--fs-sm); }
.event-itinerary__dash { margin: 0 var(--space-1); color: var(--color-text-secondary); }
.event-itinerary__text { width: 50%; }
.event-itinerary__text .input { width: 100%; padding: 6px var(--space-2); font-size: var(--fs-sm); }
.event-itinerary__where { color: var(--color-text-secondary); font-size: var(--fs-sm); }
.event-itinerary__actions { white-space: nowrap; text-align: right; }
.event-itinerary__row--meal td { background: var(--color-surface-2); font-size: var(--fs-sm); }
.event-itinerary__meal-name { font-weight: var(--fw-semibold); }
.event-itinerary__tag { font-size: 10px; padding: 1px 7px; vertical-align: middle; }
.event-itinerary__meal-link { font-size: var(--fs-xs); }

/* A narrow card stacks each row instead of scrolling the table sideways
   (a phone, and an iPad held upright beside the full sidebar, both leave
   the four columns too little room): the times on the first line, the
   label or meal with its × or Edit in Meals on the second, the location
   under them. The card's own width decides, hence a container query; a
   browser without them keeps the table, which scrolls in place. */
.event-itinerary { container-type: inline-size; }
@container (max-width: 640px) {
  .event-itinerary .event-itinerary__table,
  .event-itinerary .event-itinerary__table tbody { display: block; overflow: visible; }
  .event-itinerary .event-itinerary__table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "times times" "text actions" "where where";
    align-items: center;
    gap: var(--space-1) var(--space-2);
    padding: var(--space-2);
    border-bottom: 1px solid var(--color-divider-soft);
  }
  .event-itinerary .event-itinerary__table tr:last-child { border-bottom: none; }
  .event-itinerary .event-itinerary__table td { display: block; min-width: 0; padding: 0; border: none; background: transparent; }
  .event-itinerary .event-itinerary__table .event-itinerary__times { grid-area: times; display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--space-1); }
  .event-itinerary .event-itinerary__times .input { flex: 1 1 100px; width: auto; max-width: 118px; }
  .event-itinerary .event-itinerary__text { grid-area: text; width: auto; }
  .event-itinerary .event-itinerary__where { grid-area: where; }
  .event-itinerary .event-itinerary__where:empty { display: none; }
  .event-itinerary .event-itinerary__actions { grid-area: actions; }
  .event-itinerary .event-itinerary__row--meal { background: var(--color-surface-2); }
}

/* The itinerary's days fold on a phone: one open at a time (today's, else
   the first), the whole heading row its toggle. A wider screen shows every
   day and no toggle. */
.event-day__head { position: relative; }
.event-day__toggle { display: none; }
@media (max-width: 640px) {
  .event-itinerary .event-day__head {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-right: var(--space-6);
  }
  .event-itinerary .event-day__head .event-day__title { margin: 0; }
  .event-itinerary .event-day__head::after {
    content: "";
    position: absolute;
    right: var(--space-2);
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-text-secondary);
    border-bottom: 2px solid var(--color-text-secondary);
    transform: translateY(-75%) rotate(45deg);
    pointer-events: none;
  }
  .event-itinerary .event-day.is-open .event-day__head::after { transform: translateY(-25%) rotate(-135deg); }
  .event-itinerary .event-day__toggle {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
  }
  .event-itinerary .event-day.is-open .event-day__head { margin-bottom: var(--space-2); }
  .event-itinerary .event-day.is-collapsed { margin-bottom: 0; border-bottom: 1px solid var(--color-divider-soft); }
  .event-itinerary .event-day.is-collapsed .event-day__body { display: none; }
}

/* One meal: a header line — time · name · location · covers · dishes —
   that opens it, then the main line, the count line and the menu. One
   meal open at a time. */
.event-meal {
  border-left: 3px solid var(--color-divider);
  margin-bottom: var(--space-2);
}
.event-meal.is-open { border-left-color: var(--fb-blue); }
.event-meal__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.event-meal__head:hover { background: var(--color-hover); }
.event-meal__summary { flex: 1 1 auto; min-width: 0; }
.event-meal__summary > span { white-space: nowrap; }
.event-meal__summary > .event-meal__sep { white-space: normal; color: var(--color-text-tertiary); }
.event-meal__sum-name { font-weight: var(--fw-semibold); }
.event-meal__sum-time,
.event-meal__sum-where,
.event-meal__sum-dishes { color: var(--color-text-secondary); }
.event-meal__chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: 0 var(--space-1) 4px;
  border-right: 2px solid var(--color-text-secondary);
  border-bottom: 2px solid var(--color-text-secondary);
  transform: rotate(45deg);
}
.event-meal.is-open .event-meal__chevron { margin-bottom: 0; margin-top: 4px; transform: rotate(-135deg); }
.event-meal__body { padding: var(--space-1) 0 var(--space-3) var(--space-3); }
.event-meal__body[hidden] { display: none; }
.event-meal__main,
.event-meal__count {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.event-meal__main .input,
.event-meal__count .input { padding: 6px var(--space-2); font-size: var(--fs-sm); }
/* The compact count selects keep the base .select's right padding, so the text clears the arrow. */
.event-meal__count .select { padding: 6px var(--space-7) 6px var(--space-2); font-size: var(--fs-sm); }
.event-meal__name { flex: 1 1 140px; min-width: 120px; font-weight: var(--fw-semibold); }
.event-meal__times { white-space: nowrap; }
.event-meal__times .input { width: 118px; display: inline-block; }
.event-meal__location { flex: 1 1 160px; min-width: 140px; }
.event-meal__count { margin-top: var(--space-2); }
.event-meal__field { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-xs); color: var(--color-text-secondary); }
.event-meal__field .select { width: auto; }
.event-meal__custom .input { width: 80px; }
.event-meal__custom[hidden] { display: none; }
.event-meal__covers { margin-left: auto; font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; }
.event-meal__menu { width: 100%; margin-top: var(--space-2); min-height: 4.5em; font-size: var(--fs-sm); }
@media (max-width: 640px) {
  .event-meal__covers { margin-left: 0; width: 100%; }
}

/* Rooming: the buildings checklists (the board's on-switch), then the
   board (night tabs, scope, status line, the two panes of chips and
   rooms). Built for a tablet held standing up: big tap targets, the bar
   stays put. */
.event-board__none { margin: 0; padding: var(--space-3) 0; font-size: var(--fs-sm); }
/* The rooming's state at the head of the board: Proposed, or Approved
   <date>; Approve rooming beside it for an admin. A label, never a lock. */
.event-board__state { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) 0; }
.event-board__state-word { font-size: var(--fs-sm); }
.event-board__state-note { font-size: var(--fs-xs); color: var(--color-text-secondary); }
/* A building un-ticked while it still holds a row: on the board, flagged. */
.event-board__unticked {
  margin: 0 0 var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-left: 3px solid var(--color-warning);
  background: var(--color-warning-soft);
  font-size: var(--fs-xs);
  color: #946e10;
}
.event-board__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-2) 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider-soft);
}
.event-board__nights,
.event-board__scope { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.event-board__night,
.event-board__scope-btn {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.event-board__night:hover,
.event-board__scope-btn:hover { background: var(--color-hover); }
.event-board__night.is-on,
.event-board__scope-btn.is-on {
  background: var(--fb-blue);
  border-color: var(--fb-blue);
  color: var(--color-text-on-blue);
}
.event-board__scope-btn { font-size: var(--fs-xs); padding: 6px 12px; }
.event-board__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-height: 2.4em;
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--fs-sm);
}
.event-board__say { flex: 1 1 auto; font-weight: var(--fw-medium); }
.event-board__panes {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 3fr;
  gap: var(--space-4);
  align-items: start;
}
.event-board__pane--guests {
  position: sticky;
  top: 56px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
}
.event-board__pane-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}
.event-board__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.event-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.event-chip:hover { background: var(--color-hover); }
.event-chip.is-picked {
  background: var(--fb-blue-soft);
  border-color: var(--fb-blue);
  color: var(--fb-blue);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.20);
}
.event-chip--in { padding: 5px 10px; font-size: var(--fs-xs); }
.event-chip.is-unresolved { border-style: dashed; color: var(--color-text-secondary); }
.event-chip__child { font-size: 10px; padding: 1px 6px; }
.event-board__group { margin-bottom: var(--space-4); }
.event-board__group-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}
.event-board__rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
}
.event-room {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 72px;
  padding: var(--space-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.event-room.is-vacant { background: var(--color-surface-2); border-style: dashed; }
.event-room.is-held { background: var(--color-warning-soft); border-color: var(--color-warning); border-style: solid; }
.event-room.is-contested { border-color: var(--color-danger); box-shadow: inset 3px 0 0 var(--color-danger); }
.event-room.is-ready .event-room__target { cursor: copy; }
.event-room.is-ready:hover { border-color: var(--fb-blue); box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.20); }
.event-room__target {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
  width: 100%;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.event-room__target:hover { background: var(--color-hover); }
.event-room__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.event-room__bed { font-size: 10px; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.event-room__state { margin-left: auto; font-size: var(--fs-xs); color: var(--color-text-secondary); }
.event-room.is-held .event-room__state { color: #946e10; font-weight: var(--fw-semibold); }
.event-room__party { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.event-room__hold {
  align-self: flex-start;
  margin-top: auto;
  padding: 2px 8px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.event-room__hold:hover { color: var(--color-text); background: var(--color-hover); }
.event-buildings { margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-divider-soft); }
.event-buildings__lists { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.event-buildings__list { margin: 0; padding: 0; border: none; min-width: 0; }
.event-buildings__list legend { padding: 0; }
.event-buildings__check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 var(--space-3) var(--space-2) 0;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.event-buildings__check input { width: 18px; height: 18px; margin: 0; }
.event-buildings__sentence { margin: var(--space-2) 0 0; font-size: var(--fs-sm); line-height: 1.45; }

/* The print controls on the action row: Print order with its two include
   boxes beside it, then Print rooming and Print menu. */
.event-print {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.event-print__include {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
}
.event-print__include input { width: 18px; height: 18px; margin: 0; }

/* The before-you-print modal: the findings, warnings first, then Print anyway / Go back. */
.event-print-ask__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); max-height: 50vh; overflow-y: auto; }
.event-print-ask__item { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--fs-sm); line-height: 1.4; }
.event-print-ask__item .event-finding__kind { flex: 0 0 auto; }
.event-print-ask__item--note .event-finding__kind { opacity: 0.85; }

/* ---------------------------------------------------------
   Wrap-up: approving a group's stays (js/wrapup.js)
   --------------------------------------------------------- */
.wrapup-home { display: grid; gap: var(--space-4); }
.wrapup-list { display: flex; flex-direction: column; gap: var(--space-2); }
.wrapup-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-sans);
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.wrapup-list__item:hover { background: var(--color-hover); }
.wrapup-list__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wrapup-list__name { font-weight: var(--fw-semibold); }
.wrapup-list__meta { font-size: var(--fs-sm); color: var(--color-text-secondary); }
.wrapup-list__count { font-size: var(--fs-sm); white-space: nowrap; color: var(--color-text-secondary); }
.wrapup-list__actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.wrapup-stat { font-size: var(--fs-xl); font-weight: var(--fw-semibold); margin: 0 0 var(--space-1); }
.wrapup-note { margin: 0; font-size: var(--fs-sm); color: var(--color-text-secondary); line-height: 1.45; }

.wrapup-board__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.wrapup-board__count { font-size: var(--fs-sm); color: var(--color-text-secondary); }
.wrapup-board__count.is-done { color: var(--color-success, #2f7d4f); font-weight: var(--fw-semibold); }
.wrapup-board__actions { margin-left: auto; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.wrapup-table-wrap { overflow-x: auto; }
/* Wide enough that the warnings read as sentences; a narrow screen scrolls the table sideways rather than squeezing it. */
.wrapup-table { min-width: 1000px; }
.wrapup-table td { vertical-align: top; }
.wrapup-table .input[type="date"] { min-width: 9rem; }
.wrapup-table td:nth-child(4) { min-width: 10rem; }
.wrapup-table td:nth-child(5) { min-width: 9rem; }
.wrapup-table td:nth-child(7) { min-width: 16rem; }
.wrapup-row.is-approved { opacity: 0.55; }
.wrapup-row.is-approved .btn-sm { opacity: 1; }
.wrapup-row__name { font-weight: var(--fw-semibold); white-space: nowrap; }
.wrapup-row__open { display: block; font-size: var(--fs-xs); color: var(--color-text-secondary); white-space: nowrap; }
.wrapup-row__rooms { font-size: var(--fs-sm); }
.wrapup-row__rooms a { margin-left: var(--space-1); font-size: var(--fs-xs); }
.wrapup-hunts__toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--fb-blue); font-family: var(--font-sans); font-size: var(--fs-sm); text-align: left;
}
.wrapup-hunts__list { margin: var(--space-1) 0 0; padding: 0; list-style: none; font-size: var(--fs-xs); color: var(--color-text-secondary); }
.wrapup-hunts__list li { white-space: nowrap; }
.wrapup-hunts__list li.is-outside { color: #946e10; }
.wrapup-hunts__catchup { display: block; margin-top: var(--space-1); font-size: var(--fs-xs); color: var(--color-text-secondary); white-space: normal; max-width: 16rem; }
.wrapup-table td[data-cell="notes"] .input { min-width: 10rem; }
.wrapup-warnings { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); max-width: 22rem; }
.wrapup-warnings li { padding-left: var(--space-2); border-left: 3px solid var(--color-divider); line-height: 1.35; }
.wrapup-warnings li.is-warning { border-left-color: var(--color-warning); }
.wrapup-row__action { white-space: nowrap; }
.wrapup-row__action .btn-sm { margin: 0 var(--space-1) var(--space-1) 0; }
.wrapup-row__approved { display: block; font-size: var(--fs-xs); color: var(--color-text-secondary); margin-bottom: 4px; }
.wrapup-row__group { display: block; }
.wrapup-list__item--stay { cursor: default; flex-wrap: wrap; }
.wrapup-list__item--stay:hover { background: var(--color-surface); }
.wrapup-list__item--stay .wrapup-list__actions { flex: 1 1 100%; }
/* Ranch hunts: a row is not a link; an approved one greys out and keeps its Undo at full strength. */
.wrapup-list__item--ranch { cursor: default; flex-wrap: wrap; }
.wrapup-list__item--ranch:hover { background: var(--color-surface); }
.wrapup-list__item--ranch .wrapup-list__actions { align-items: center; margin-left: auto; }
.wrapup-list__item--ranch .wrapup-row__approved { margin: 0; white-space: nowrap; }
.wrapup-list__item--ranch.is-approved .wrapup-list__main { opacity: 0.55; }
#wrapup-ranch .wrapup-note { margin-top: var(--space-3); }
/* No group: a stay's line is not a link (the guest's name is); Open in the header goes to #/wrapup/none. */
.wrapup-list__item--nogroup { cursor: default; }
.wrapup-list__item--nogroup:hover { background: var(--color-surface); }
/* Hunts with no stay: Log the stay opens its form under the hunt, across the whole row. */
.wrapup-list__item--hunt { cursor: default; flex-wrap: wrap; }
.wrapup-list__item--hunt:hover { background: var(--color-surface); }
.wrapup-list__item--hunt .wrapup-list__actions { margin-left: auto; }
.wrapup-logstay { flex: 1 1 100%; min-width: 0; }
.wrapup-logstay[hidden] { display: none; }
.log-stay { padding-top: var(--space-3); border-top: 1px dashed var(--color-divider); }
.log-stay__hint { margin: 0; font-size: var(--fs-xs); color: var(--color-text-secondary); }
#wrapup-hunts .wrapup-note { margin-top: var(--space-3); }

/* ---------------------------------------------------------
   Stays (Cohesion B): the "pending wrap-up" and "group" tags, the group
   control every stay row carries, At the Ranch and Arrival on the
   Dashboard, the profile's stay history.
   --------------------------------------------------------- */
.pending-tag { margin-left: var(--space-1); white-space: nowrap; font-weight: var(--fw-medium, 500); }
.event-group-tag { margin-left: var(--space-1); font-size: 10px; padding: 1px 7px; background: var(--color-hover, #f0f2f5); color: var(--color-text-secondary); text-transform: lowercase; vertical-align: middle; }

.stay-group { display: inline-block; max-width: 100%; }
.stay-group.is-open { display: block; }
.stay-group__panel {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  white-space: normal;
  min-width: 16rem;
}
.stay-group__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); margin-bottom: var(--space-2); }
.stay-group__move { padding-top: var(--space-2); border-top: 1px dashed var(--color-divider); }

.dash-ranch__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.dash-group { padding: var(--space-1) 0 var(--space-2); }
.dash-group + .dash-group { border-top: 1px solid var(--color-divider-soft, #eef0f3); }
.dash-group__head { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-2) 16px 2px; }
.dash-group__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.dash-group__count { margin-left: auto; font-size: var(--fs-xs); color: var(--color-text-secondary); }
.dash-stay__main { display: flex; align-items: center; gap: 12px; padding: 8px 16px; flex-wrap: wrap; }
.dash-stay__avatar { flex-shrink: 0; }
.dash-stay__name { display: block; text-decoration: none; }
.dash-stay__name:hover { text-decoration: underline; }
.dash-stay__actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-left: auto; }
.dash-stay__panel { padding: 0 16px 12px; }
.dash-stay__panel[hidden] { display: none; }
.dash-stay__form, .dash-arrival { display: flex; flex-direction: column; gap: var(--space-2); }
.dash-stay__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-2); }
.dash-stay__field { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); color: var(--color-text-secondary); min-width: 0; }
.dash-stay__field > span { font-weight: var(--fw-semibold); }
.dash-stay__buttons { display: flex; justify-content: flex-end; gap: var(--space-2); }
.dash-stay__error:empty { display: none; }
.dash-stay__newgroup { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.dash-stay__newgroup[hidden] { display: none; }
.dash-arrival { margin: var(--space-2) 16px var(--space-3); padding: var(--space-3); border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface-2, #f7f8fa); }
.dash-arrival__title { font-weight: var(--fw-semibold); }
.dash-arrival__guest { display: flex; align-items: flex-start; gap: var(--space-2); }
.dash-arrival__guest > div { flex: 1 1 auto; min-width: 0; }
.dash-arrival__picked { font-size: var(--fs-sm); }
/* The Arriving list: one line per guest — the name, the guest's own room, a remove × — and the reason under a line that did not save. */
.dash-arrival__arriving { display: flex; flex-direction: column; gap: var(--space-1); }
.dash-arrival__label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--color-text-secondary); }
.dash-arrival__list { display: flex; flex-direction: column; gap: var(--space-2); }
.dash-arrival__list:empty { display: none; }
.dash-arrival__line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface); }
.dash-arrival__name { flex: 1 1 6rem; min-width: 0; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.dash-arrival__line .select { flex: 0 1 12rem; width: auto; min-width: 0; }
.dash-arrival__remove { flex: 0 0 auto; font-size: var(--fs-md); line-height: 1; }
.dash-arrival__reason { flex: 1 1 100%; font-size: var(--fs-sm); }
.dash-arrival__reason:empty { display: none; }
@media (max-width: 600px) {
  /* A phone: the name and × on one line, the room under them across the line. */
  .dash-arrival__remove { order: 2; }
  .dash-arrival__line .select { order: 3; flex: 1 1 100%; }
  .dash-arrival__reason { order: 4; }
}
.dash-upcoming__row { text-decoration: none; color: inherit; }

.stay-history__status { white-space: nowrap; }
.stay-history__status .stay-group { margin-left: var(--space-1); }
.diary-history-note { margin: calc(-1 * var(--space-2)) 0 var(--space-3); font-size: var(--fs-sm); }

.event-form__informal { display: flex; flex-direction: column; gap: 2px; }
.event-form__hint { font-size: var(--fs-xs); }
.event-editor__group-note { margin: 0 0 var(--space-3); font-size: var(--fs-sm); }
.event-card--group { border-style: dashed; }

/* The occupied-room question: three answers, each a sentence. */
.event-ask__modal { max-width: 460px; }
.event-ask__lead { margin: 0 0 var(--space-3); font-size: var(--fs-sm); color: var(--color-text-secondary); }
.event-ask__choices { display: flex; flex-direction: column; gap: var(--space-2); }
.event-ask__choice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
}
.event-ask__choice:hover { background: var(--color-hover); border-color: var(--fb-blue); }
.event-ask__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.event-ask__detail { font-size: var(--fs-xs); color: var(--color-text-secondary); }

@media (max-width: 768px) {
  .event-board__panes { grid-template-columns: 1fr; }
  .event-board__pane--guests { position: static; }
  .event-buildings__lists { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------
   Events insights (#/events/insights): the season picker in the
   header, the Dashboard's stat cards in a row, then a card per
   question, each a compact table. Two columns; one on a phone.
   --------------------------------------------------------- */
.insights__header .view-actions { align-items: center; }
.insights__season-label { font-size: var(--fs-sm); color: var(--color-text-secondary); }
.insights__season { width: auto; min-width: 120px; }
.insights__stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: var(--space-5);
  min-width: 0;
}
.insights__stats .card { margin-bottom: 0; min-width: 0; }
.insights__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}
.insights-card { margin-bottom: 0; min-width: 0; }
.insights-card .card-header h3 {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.insights-card__note { font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--color-text-secondary); }
.insights-card__sub {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}
.insights-table th,
.insights-table td { padding: var(--space-2) var(--space-3); font-size: var(--fs-sm); }
.insights-table__num { text-align: right; white-space: nowrap; }
.insights-table__bar { width: 34%; }
.insights-bar {
  height: 10px;
  min-width: 60px;
  background: var(--color-surface-2);
  border-radius: 5px;
  overflow: hidden;
}
.insights-bar__fill { height: 100%; background: var(--fb-blue); border-radius: 5px; }
.insights__line { margin: var(--space-3) 0 0; font-size: var(--fs-sm); }
.insights__unused { color: var(--color-text-secondary); }
.insights__caveat {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-warning);
  background: var(--color-warning-soft);
  font-size: var(--fs-sm);
}
.insights__none { margin: 0; font-size: var(--fs-sm); }
.insights__empty { margin: 0; font-size: var(--fs-md); color: var(--color-text-secondary); }
.insights__guest { color: inherit; font-weight: var(--fw-medium); }
@media (max-width: 1024px) {
  .insights__stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .insights__grid { grid-template-columns: 1fr; }
  .insights__stats { grid-template-columns: repeat(2, 1fr); }
  .insights__header .view-actions { width: 100%; }
  .insights__season { flex: 1 1 auto; }
}

/* ---------------------------------------------------------
   Property (#/events/property): every room, night by night,
   across every event. One table so the nights line up from
   Cabins to Red Leaf Inn; the room column sticks and on a
   phone the nights scroll sideways under it. A group row, a
   building's vacant line and a turnover ("A out · B in")
   are the three things to read besides the names.
   --------------------------------------------------------- */
.property__header .view-actions { align-items: center; }
.property__range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); }
.property__field { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--color-text-secondary); }
.property__field .input { width: auto; min-width: 150px; }
.property__none { margin: 0 0 var(--space-3); font-size: var(--fs-sm); }
.property__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.property-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.property-table th,
.property-table td { padding: var(--space-2); border-bottom: 1px solid var(--color-divider-soft); text-align: left; vertical-align: top; }
.property-table thead th {
  background: var(--color-surface-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.property-table .property__room {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 7.5rem;
  max-width: 10rem;
  background: var(--color-surface);
  font-weight: var(--fw-semibold);
  box-shadow: 1px 0 0 var(--color-divider-soft);
}
.property-table thead .property__room { z-index: 2; background: var(--color-surface-2); }
/* The default eight nights fit a 1280px screen beside the sidebar; more scroll sideways. */
.property__night,
.property__cell { min-width: 7rem; }
.property__cell.is-flip { box-shadow: inset 3px 0 0 var(--color-warning); }
.property__cell.is-contested { background: var(--color-danger-soft); box-shadow: inset 3px 0 0 var(--color-danger); }
.property__flip { display: block; margin-bottom: 2px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: #946e10; }
.property__party { display: block; }
.property__party + .property__party { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--color-divider); }
.property__names { display: block; font-weight: var(--fw-medium); }
.property__group { display: block; font-size: var(--fs-xs); color: var(--color-text-secondary); }
.property__held { display: block; font-style: italic; color: #946e10; }
.property__grouprow th {
  background: var(--color-surface-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.property__vacantrow td { font-size: var(--fs-xs); font-style: italic; color: var(--color-text-secondary); }
/* The words of a full-width row stay in view while the nights scroll under them. */
.property__sticky { position: sticky; left: var(--space-2); display: inline-block; }
@media (max-width: 768px) {
  .property__header .view-actions { width: 100%; }
  .property__header .view-actions .btn { flex: 1 1 auto; }
  .property__field { flex: 1 1 8rem; }
  .property__field .input { min-width: 0; width: 100%; }
  .property-table .property__room { min-width: 7rem; max-width: 8rem; }
  .property__night,
  .property__cell { min-width: 7.5rem; }
}
