/* ==========================================================================
 * Event Studio - Booth visits (js/views/booth-visits.js, Milestone C, beta)
 *
 *  1. Page and tabs        st-bv  st-bv-panel
 *  2. Setup                st-bv-setup  st-bv-ids  st-bv-promise  st-bv-steps
 *  3. Beacons              st-bv-toolbar  st-bv-minor  st-bv-hw  st-bv-plan  st-bv-review
 *  4. Labels               st-bv-labels  st-bv-sheet (the .bvl-* labels: ui/booth-labels.js)
 *  5. Placement            st-bv-place  st-bv-group  st-bv-warn  st-bv-map  st-bv-legend
 *  6. Results              st-bv-results  st-bv-few
 *  7. My stand card        st-bv-est (ui/stand-dashboard.js)
 *  8. Narrow screens, reduced motion
 * ========================================================================== */

/* ---------- 1. Page and tabs ---------- */
.st-bv > .st-tabs { margin-bottom: 18px; }
.st-bv-panel { min-width: 0; }

/* ---------- 2. Setup ---------- */
.st-bv-setup { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.st-bv-switch-note:empty { display: none; }
.st-bv-switch-note__line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--st-text-dim); }
.st-bv-switch-note__line .st-icon { color: var(--st-text-muted); flex: 0 0 auto; }
.st-bv-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-top: 4px; }
.st-bv-numbers .st-details-unit { max-width: 200px; }
.st-bv-numbers__foot { display: flex; justify-content: flex-end; gap: 8px; }

.st-bv-ids { display: flex; flex-direction: column; gap: 8px; }
.st-bv-id {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 44px; padding: 6px 8px 6px 12px; border: 1px solid var(--st-border); border-radius: var(--st-r-10); background: rgba(255, 255, 255, 0.02);
}
.st-bv-id__label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--st-text-muted); }
.st-bv-id__value { font-family: var(--st-mono); font-size: 14px; letter-spacing: 0.02em; color: var(--st-text); overflow-wrap: anywhere; }
.st-bv-id__hint { grid-column: 2 / -1; font-size: 13px; color: var(--st-text-dim); }
.st-bv-ids__empty { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--st-text-dim); line-height: 1.5; }
.st-bv-ids__empty .st-icon { margin-top: 2px; color: var(--st-lavender); flex: 0 0 auto; }

.st-bv-promise__list { display: flex; flex-direction: column; gap: 12px; }
.st-bv-promise__item { display: flex; gap: 11px; align-items: flex-start; }
.st-bv-promise__icon {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
  background: rgba(109, 92, 255, 0.14); color: var(--st-lavender);
}
.st-bv-promise__text { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; line-height: 1.45; color: var(--st-text-dim); }
.st-bv-promise__text strong { color: var(--st-text); font-weight: 600; }
.st-bv-estimated {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--st-border);
  font-size: 13px; line-height: 1.5; color: var(--st-text-muted);
}
.st-bv-estimated .st-icon { margin-top: 2px; flex: 0 0 auto; }

.st-bv-steps { counter-reset: bv-step; display: flex; flex-direction: column; gap: 10px; }
.st-bv-steps li {
  counter-increment: bv-step; position: relative; padding-left: 34px; font-size: 13.5px; line-height: 1.5; color: var(--st-text-dim);
}
.st-bv-steps li::before {
  content: counter(bv-step); position: absolute; left: 0; top: 0; display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 999px; background: var(--st-bg-hover); color: var(--st-text);
  font-size: 12px; font-weight: 600;
}
.st-bv-steps strong { color: var(--st-text); font-weight: 600; }
.st-bv-howto__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- 3. Beacons ---------- */
.st-bv-intro { display: flex; flex-direction: column; gap: 4px; }
.st-bv-summary { font-size: 13.5px; color: var(--st-text-dim); }
.st-bv-hint { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--st-text-muted); }
.st-bv-hint .st-icon { flex: 0 0 auto; }
.st-bv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.st-bv-toolbar .st-toolbar { margin: 0; }
.st-bv-toolbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-bv-beacons .st-table__table { table-layout: fixed; min-width: 980px; }
.st-bv-beacons .st-table__table td { overflow: hidden; }
.st-bv-beacons tr.is-problem td:first-child { box-shadow: inset 3px 0 0 var(--st-red); }

.st-bv-minor {
  display: inline-block; white-space: nowrap; min-width: 34px; padding: 1px 7px; border-radius: 6px; text-align: center;
  background: rgba(109, 92, 255, 0.16); color: var(--st-lavender);
  font-family: var(--st-mono); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.st-bv-hw { font-family: var(--st-mono); font-size: 12px; color: var(--st-text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.st-bv-note { display: block; color: var(--st-text-dim); }
.st-bv-gone { display: inline-flex; align-items: center; gap: 5px; color: #fcd34d; }
.st-bv-tools { display: inline-flex; align-items: center; gap: 2px; }
.st-bv-stand { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-bv-stand__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-bv-stand__booth { font-size: 12px; color: var(--st-text-muted); }

.st-bv-plan { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 8px; }
.st-bv-plan li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.st-bv-plan .st-icon { color: var(--st-text-muted); }

.st-bv-editor { display: flex; flex-direction: column; gap: 14px; }
.st-bv-editor .st-details-unit { max-width: 180px; }

.st-bv-import { --st-modal-w: 820px; }
.st-bv-import__pick { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; }
.st-bv-paste { font-family: var(--st-mono); font-size: 12.5px; min-height: 160px; }
.st-bv-review { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; max-height: 46vh; overflow: auto; }
.st-bv-review__title { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.st-bv-review__title .st-icon { color: var(--st-lavender); }
.st-bv-review__group.is-problem .st-bv-review__title .st-icon { color: var(--st-red); }
.st-bv-review__list { display: flex; flex-direction: column; gap: 4px; }
.st-bv-review__list li { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--st-text-dim); }
.st-bv-review__warnings { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; list-style: disc; padding-left: 18px; }
.st-bv-review__line { flex: 0 0 auto; min-width: 58px; font-size: 12px; font-weight: 600; color: var(--st-text-muted); font-variant-numeric: tabular-nums; }

/* ---------- 4. Labels ---------- */
.st-bv-labels { --st-modal-w: 880px; }
.st-bv-labels .st-chips { margin: 12px 0 0; }
.st-bv-sheet__caption { margin: 12px 0 8px; font-size: 13px; color: var(--st-text-muted); }
.st-bv-sheet__frame {
  max-height: 56vh; overflow: auto; padding: 18px; border-radius: var(--st-r-10);
  background: #2a2f3d; border: 1px solid var(--st-border);
}
/* A sheet of paper, at 80 %: 63 mm labels are wide for a dialog. */
.st-bv-sheet { width: max-content; margin: 0 auto; padding: 10mm; background: #fff; zoom: 0.8; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }

/* ---------- 5. Placement ---------- */
.st-bv-place { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.st-bv-place__list .st-card__body { display: flex; flex-direction: column; gap: 14px; }
.st-bv-place__counts { display: flex; flex-wrap: wrap; gap: 6px; }
.st-bv-place__groups { display: flex; flex-direction: column; gap: 16px; max-height: calc(100dvh - 420px); min-height: 160px; overflow: auto; }
.st-bv-place__groups:empty { display: none; }
.st-bv-group__title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; }
.st-bv-group.is-problem .st-bv-group__title .st-icon { color: var(--st-red); }
.st-bv-group.is-warning .st-bv-group__title .st-icon { color: var(--st-amber); }
.st-bv-group.is-info .st-bv-group__title .st-icon { color: var(--st-text-muted); }
.st-bv-group__count {
  margin-left: auto; padding: 0 7px; border-radius: 999px; background: var(--st-bg-hover);
  font-size: 12px; font-weight: 600; color: var(--st-text-dim); font-variant-numeric: tabular-nums;
}
.st-bv-group__help { margin: 3px 0 6px; font-size: 12.5px; line-height: 1.45; color: var(--st-text-muted); }
.st-bv-group__list { display: flex; flex-direction: column; gap: 2px; }
.st-bv-warn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--st-r-8);
  background: transparent; color: var(--st-text-dim); font: inherit; font-size: 13px; line-height: 1.4; text-align: left; cursor: pointer;
  transition: background-color var(--st-ease), color var(--st-ease);
}
.st-bv-warn:hover:not(:disabled) { background: var(--st-bg-hover); color: var(--st-text); }
.st-bv-warn:disabled { cursor: default; }
.st-bv-warn.is-selected { background: rgba(109, 92, 255, 0.16); color: var(--st-text); }
.st-bv-warn__text { flex: 1 1 auto; min-width: 0; }
.st-bv-warn .st-icon { flex: 0 0 auto; color: var(--st-text-muted); }

.st-bv-map { position: relative; height: max(420px, calc(100dvh - 330px)); background: var(--st-bg-elev); }
/* Two classes: Mapbox's own .mapboxgl-map { position: relative } loads later. */
.st-bv-map > .st-bv-map__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-bv-map__wait { position: absolute; inset: 0; display: grid; place-items: center; }
.st-bv-map .st-map-fallback { position: absolute; inset: 0; }
.st-bv-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 16px;
  border-top: 1px solid var(--st-border); font-size: 12.5px; color: var(--st-text-dim);
}
.st-bv-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.st-bv-legend__ring { width: 12px; height: 12px; border-radius: 999px; border: 2.5px solid; }

/* ---------- 6. Results ---------- */
.st-bv-results { display: flex; flex-direction: column; gap: 14px; }
.st-bv-results__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.st-bv-results__zone { font-size: 13px; color: var(--st-text-muted); }
.st-bv-results__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.st-bv-updated { font-size: 12.5px; color: var(--st-text-muted); }
.st-bv-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-bv-truncated { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--st-text-dim); }
.st-bv-few { font-size: 12.5px; color: var(--st-text-muted); font-style: italic; white-space: nowrap; }
.st-bv-results tr.is-off td { color: var(--st-text-muted); }
.st-bv-results .st-table__table { table-layout: fixed; min-width: 1000px; }
.st-bv-results .st-table__table td { overflow: hidden; }
.st-bv-minors { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* ---------- 7. My stand card ---------- */
.st-bv-est__title { display: inline-flex; align-items: center; gap: 8px; }
.st-bv-est__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-bv-est__note { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--st-text-muted); }
.st-bv-est__hours { margin-top: 14px; }
.st-bv-est__hours-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; }
.st-bv-est__hours-title { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--st-text-dim); }
.st-bv-est__key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--st-text-muted); }
.st-bv-est__swatch {
  width: 14px; height: 8px; border-radius: 2px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 3px, rgba(255, 255, 255, 0.08) 3px 6px);
}
.st-bv-est__plot { display: flex; align-items: flex-end; gap: 4px; height: 72px; }
.st-bv-est__col { flex: 1 1 0; min-width: 6px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.st-bv-est__bar { border-radius: 3px 3px 0 0; background: var(--st-violet); min-height: 2px; }
.st-bv-est__col.is-hidden .st-bv-est__bar { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 3px, rgba(255, 255, 255, 0.08) 3px 6px); height: 8px; }
.st-bv-est__axis { display: flex; gap: 4px; margin-top: 4px; font-size: 10.5px; color: var(--st-text-muted); }
.st-bv-est__axis span { flex: 1 1 0; min-width: 6px; text-align: center; white-space: nowrap; overflow: visible; }

/* ---------- 8. Narrow screens, reduced motion ---------- */
@media (max-width: 1180px) {
  .st-bv-setup, .st-bv-place { grid-template-columns: minmax(0, 1fr); }
  .st-bv-place__groups { max-height: none; }
}
@media (max-width: 720px) {
  .st-bv-numbers, .st-bv-tiles { grid-template-columns: minmax(0, 1fr); }
  .st-bv-id { grid-template-columns: minmax(0, 1fr) auto; }
  .st-bv-id__label { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .st-bv-warn { transition: none; }
}
