/* bv18.css — Beach Insurance Investment Properties (A2 Split-Curtain Comparator)
   Coastal Carolinas Sunlit Editorial. Strictly scoped to .bv18-* selectors.
   WCAG 2.2 AA compliant, zero CLS, zero horizontal overflow at 390px. */

.bv18-shell {
  box-sizing: border-box;
  background: #FFFFFF;
  border: 1px solid rgba(13, 59, 110, 0.14);
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(13, 59, 110, 0.05), 0 18px 40px -18px rgba(13, 59, 110, 0.18);
  padding: clamp(0.9rem, 2.2vw, 1.5rem);
  color: #334155;
}

.bv18-shell *,
.bv18-shell *::before,
.bv18-shell *::after {
  box-sizing: border-box;
}

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

/* Toolbar: Presets + Slider */
.bv18-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.25rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #F5F0E8 0%, #EEF4FB 100%);
  border: 1px solid rgba(13, 59, 110, 0.12);
  border-radius: 16px;
}

.bv18-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.bv18-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 0.95rem;
  border: 2px solid rgba(13, 59, 110, 0.22);
  border-radius: 999px;
  background: #FFFFFF;
  color: #0D3B6E;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.bv18-preset:hover {
  border-color: #1565A8;
  background: #EEF4FB;
}

.bv18-preset:active {
  transform: scale(0.97);
}

.bv18-preset.is-active,
.bv18-preset[aria-pressed="true"] {
  background: #0D3B6E;
  border-color: #0D3B6E;
  color: #FFFFFF;
}

.bv18-preset[data-bv18-preset="100"].is-active,
.bv18-preset[data-bv18-preset="100"][aria-pressed="true"] {
  background: #0B6B52;
  border-color: #0B6B52;
  color: #FFFFFF;
}

.bv18-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.bv18-dot--risk { background: #B91C1C; }
.bv18-dot--split { background: #D4A017; }
.bv18-dot--shield { background: #0F8A6A; }
.bv18-preset[aria-pressed="true"] .bv18-dot--risk { background: #FCA5A5; }
.bv18-preset[aria-pressed="true"] .bv18-dot--shield { background: #A7F3D0; }

/* Range Slider Control */
.bv18-slider-wrap {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bv18-slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0D3B6E;
}

.bv18-pct-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #D4A017;
  color: #0D3B6E;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bv18-shell[data-state="risk"] .bv18-pct-badge {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid rgba(153, 27, 27, 0.28);
}

.bv18-shell[data-state="shield"] .bv18-pct-badge {
  background: #0B6B52;
  color: #FFFFFF;
}

.bv18-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.bv18-range::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #B91C1C 0%, #D4A017 50%, #0B6B52 100%);
  border: 1px solid rgba(13, 59, 110, 0.22);
}

.bv18-range::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #B91C1C 0%, #D4A017 50%, #0B6B52 100%);
  border: 1px solid rgba(13, 59, 110, 0.22);
}

.bv18-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -10px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 4px solid #0D3B6E;
  box-shadow: 0 3px 10px rgba(13, 59, 110, 0.3);
  cursor: grab;
}

.bv18-range::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 4px solid #0D3B6E;
  box-shadow: 0 3px 10px rgba(13, 59, 110, 0.3);
  cursor: grab;
}

/* Stage Container: Zero CLS locked aspect ratio */
.bv18-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 420;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(13, 59, 110, 0.16);
  background: #EEF4FB;
  touch-action: pan-y;
  user-select: none;
}

.bv18-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bv18-corner-pill {
  position: absolute;
  top: 0.7rem;
  z-index: 2;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(13, 59, 110, 0.14);
}

.bv18-corner-pill--left {
  left: 0.75rem;
  background: #FFFFFF;
  color: #991B1B;
  border: 1.5px solid #B91C1C;
}

.bv18-corner-pill--right {
  right: 0.75rem;
  background: #0B6B52;
  color: #FFFFFF;
  border: 1.5px solid #FFFFFF;
}

/* Interactive 44x44 Drag Knob aligned to SVG curtain divider */
.bv18-drag-knob {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: ew-resize;
  z-index: 3;
}

.bv18-drag-knob:focus-visible {
  outline: 3px solid #0B6B52;
  outline-offset: 4px;
}

/* Verdict Strip */
.bv18-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: #FDF6E3;
  border: 1px solid rgba(212, 160, 23, 0.42);
}

.bv18-shell[data-state="risk"] .bv18-verdict {
  background: #FEF2F2;
  border-color: rgba(185, 28, 28, 0.3);
}

.bv18-shell[data-state="shield"] .bv18-verdict {
  background: #E4F5F0;
  border-color: rgba(11, 107, 82, 0.32);
}

.bv18-verdict-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: #D4A017;
  color: #0D3B6E;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.bv18-shell[data-state="risk"] .bv18-verdict-tag {
  background: #991B1B;
  color: #FFFFFF;
}

.bv18-shell[data-state="shield"] .bv18-verdict-tag {
  background: #0B6B52;
  color: #FFFFFF;
}

.bv18-verdict-copy {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  color: #0D3B6E;
  flex: 1 1 240px;
  min-width: 0;
}

/* 4-Pillar Synced Readout Cards */
.bv18-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.bv18-card {
  min-width: 0;
  background: #F5F0E8;
  border: 1px solid rgba(13, 59, 110, 0.14);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.bv18-shell[data-state="risk"] .bv18-card {
  background: #FFF8F8;
  border-color: rgba(185, 28, 28, 0.24);
}

.bv18-shell[data-state="shield"] .bv18-card {
  background: #EEF4FB;
  border-color: rgba(11, 107, 82, 0.28);
}

.bv18-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.bv18-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0D3B6E;
}

.bv18-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: #FFFFFF;
  color: #0D3B6E;
  border: 1px solid rgba(13, 59, 110, 0.2);
}

.bv18-shell[data-state="risk"] .bv18-badge {
  background: #FEF2F2;
  color: #991B1B;
  border-color: rgba(185, 28, 28, 0.32);
}

.bv18-shell[data-state="shield"] .bv18-badge {
  background: #0B6B52;
  color: #FFFFFF;
  border-color: #0B6B52;
}

.bv18-card-body {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #334155;
}

/* Gentle GPU-composited Coastal Motion */
.bv18-cloud-drift { animation: bv18-drift 16s ease-in-out infinite alternate; }
.bv18-cloud-drift-slow { animation: bv18-drift 22s ease-in-out infinite alternate-reverse; }
.bv18-wave-risk { animation: bv18-wave 5s ease-in-out infinite alternate; }
.bv18-wave-safe { animation: bv18-wave 6.5s ease-in-out infinite alternate; }
.bv18-gull { animation: bv18-float 4.2s ease-in-out infinite; }
.bv18-gull-slow { animation: bv18-float 5.6s ease-in-out infinite 0.8s; }
.bv18-smoke { animation: bv18-smoke-rise 4.5s ease-in-out infinite; }
.bv18-pulse-risk {
  transform-box: fill-box;
  transform-origin: center;
  animation: bv18-pulse 2.4s ease-out infinite;
}
.bv18-canopy-arc { animation: bv18-dash-flow 18s linear infinite; }

@keyframes bv18-drift {
  from { transform: translateX(-8px); }
  to { transform: translateX(12px); }
}

@keyframes bv18-wave {
  from { transform: translateX(-6px); }
  to { transform: translateX(8px); }
}

@keyframes bv18-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes bv18-smoke-rise {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(-6px); opacity: 0.65; }
}

@keyframes bv18-pulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.65); opacity: 0; }
}

@keyframes bv18-dash-flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -160; }
}

html.bvm-paused .bv18-shell * {
  animation-play-state: paused !important;
}

@media (max-width: 960px) {
  .bv18-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .bv18-grid {
    grid-template-columns: 1fr;
  }
  .bv18-corner-pill {
    font-size: 0.66rem;
    padding: 0.22rem 0.55rem;
    top: 0.45rem;
  }
  .bv18-corner-pill--left { left: 0.45rem; }
  .bv18-corner-pill--right { right: 0.45rem; }
  .bv18-presets {
    width: 100%;
  }
  .bv18-preset {
    flex: 1 1 auto;
    padding: 0.55rem 0.65rem;
    font-size: 0.82rem;
  }
}
