.bvd-section {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bvd-section__head { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }

.bvd {
  position: relative;
  max-width: 1064px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-shot);
  background: #fff;
}

.bvd__chrome { position: relative; }

.bvd__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: #ece9e2;
  border-bottom: 1px solid var(--line);
}
.bvd__url {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bvd__viewport { position: relative; min-height: 30rem; }

.bvd__inert { padding: 1.25rem 1.25rem 1.5rem; }
.bvd__inert[inert] { pointer-events: none; }

.bvd-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.bvd-total { display: flex; flex-direction: column; }
.bvd-total__value { font-size: 1.3rem; font-weight: 800; color: var(--espresso); font-variant-numeric: tabular-nums; }
.bvd-total__label { font-size: 0.75rem; color: var(--muted); }

.bvd__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.bvd-modes { display: flex; flex-wrap: wrap; gap: 0.4rem; border: 0; }
.bvd-mode { position: relative; }
.bvd-mode__input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.bvd-mode__label {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--body);
}
.bvd-mode__input:checked + .bvd-mode__label {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}
.bvd-mode__input:focus-visible + .bvd-mode__label {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.bvd-legend { font-size: 0.85rem; color: var(--muted); margin-left: auto; }

.bvd-3d {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--espresso);
  cursor: pointer;
}
.bvd-3d[aria-pressed="true"] { background: var(--espresso); color: #fff; border-color: var(--espresso); }
.bvd-3d[aria-disabled="true"] { cursor: not-allowed; color: var(--muted); background: var(--bg-soft); }

.bvd__stage { position: relative; }
.bvd__stage--3d { min-height: 24rem; }

.bvd-board {
  display: grid;
  gap: 0.6rem;
  padding: 0.75rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.bvd-level { display: grid; grid-template-columns: 6rem repeat(4, minmax(3.2rem, 1fr)); align-items: center; gap: 0.5rem; }
.bvd-level__label { font-size: 0.85rem; font-weight: 700; color: var(--espresso); }

.bvd-cell { display: flex; }

.bvd-unit {
  position: relative;
  width: 100%;
  min-height: 3.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  cursor: pointer;
  font-family: var(--font);
  color: #fff;
  background: #70757f;
}
.bvd-unit:focus-visible { outline: 2px solid var(--espresso); outline-offset: 2px; }
.bvd-unit__number { font-size: 0.85rem; font-weight: 700; }
.bvd-unit__token { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.bvd-unit__marker { width: 0.4rem; height: 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.85); }

.bvd-unit--occupied, .bvd-unit--current, .bvd-unit--over-90 { background: #2b8354; }
.bvd-unit--vacant, .bvd-unit--not-applicable, .bvd-unit--no-requests, .bvd-unit--no-lease, .bvd-unit--unshaded { background: #70757f; }
.bvd-unit--long-vacant, .bvd-unit--past-due, .bvd-unit--emergency, .bvd-unit--0-30, .bvd-unit--ramp-6 { background: #b42318; }
.bvd-unit--31-60, .bvd-unit--ramp-4 { background: #9d6c18; }
.bvd-unit--61-90 { background: #d0a764; color: var(--espresso); }
.bvd-unit--holdover { background: #6f2116; }
.bvd-unit--ramp-0 { background: #2f6f8f; }
.bvd-unit--ramp-1 { background: #387f95; }
.bvd-unit--ramp-2 { background: #477f64; }
.bvd-unit--ramp-3 { background: #8a6726; }
.bvd-unit--ramp-5 { background: #d0a764; color: var(--espresso); }

.bvd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-sm); touch-action: none; }
.bvd-3d-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(244, 245, 247, 0.85);
  color: var(--espresso);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}
.bvd-3d-overlay[hidden] { display: none; }

.bvd-3d-labels { position: absolute; inset: 0; pointer-events: none; }
.bvd-3d-chip {
  position: absolute;
  transform: translate(-50%, -120%);
  background: rgba(36, 26, 20, 0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.bvd-3d-chip--floor { background: rgba(138, 103, 38, 0.92); }

.bvd-3d-rebuild {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 245, 247, 0.92);
  font-weight: 700;
  color: var(--espresso);
  border-radius: var(--radius-sm);
}

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

.bvd-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.bvd-panel__overlay { position: absolute; inset: 0; background: rgba(31, 26, 32, 0.35); }
.bvd-panel__sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(20rem, 100%);
  background: #fff;
  box-shadow: -12px 0 32px rgba(31, 26, 20, 0.18);
  padding: 1.5rem;
  overflow-y: auto;
}
.bvd-panel__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-height: 2rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.bvd-panel__title { margin: 0 4.5rem 1rem 0; font-size: 1.2rem; }
.bvd-panel__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.bvd-panel__row:first-child { border-top: 0; }
.bvd-panel__row span { color: var(--muted); }
.bvd-panel__row b { color: var(--espresso); text-align: right; }
.bvd-panel__cta {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
}
.bvd-panel__cta:hover { color: #fff; text-decoration: none; }

.bvd__start {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  background: rgba(36, 26, 20, 0.28);
  color: #fff;
  cursor: pointer;
}
.bvd__start-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: #fff;
  color: var(--espresso);
  box-shadow: var(--shadow-card);
}
.bvd__start-text {
  font-weight: 700;
  font-size: 1.05rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.bvd__start:hover .bvd__start-icon,
.bvd__start:focus-visible .bvd__start-icon { transform: scale(1.06); }
.bvd__start:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.bvd__start[hidden] { display: none; }

.bvd__caption { text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 0.9rem; }

.bvd__still {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.bvd__noscript {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 700px) {
  .bvd-level { grid-template-columns: 4rem repeat(4, minmax(0, 1fr)); }
  .bvd-legend { margin-left: 0; width: 100%; order: 3; }
  .bvd-panel__sheet { width: 100%; }
}

@media (pointer: coarse) {
  .bvd-unit { min-height: 44px; }
  .bvd-3d, .bvd-panel__close { min-height: 44px; }
}

@media (prefers-contrast: more) {
  .bvd-unit { outline: 1px solid rgba(0, 0, 0, 0.35); }
  .bvd-mode__label { border-width: 2px; }
  .bvd-3d { border-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .bvd__start-icon, .bvd-unit { transition: none; }
  .bvd__start:hover .bvd__start-icon, .bvd__start:focus-visible .bvd__start-icon { transform: none; }
}

@media print {
  .bvd-section { display: none; }
}
