/* bv12.css — Beach Insurance Electricians (Archetype A6: Live Layer Toggles)
   Coastal Carolinas sunlit editorial palette. Strictly scoped to .bv12-* */

.bv12-card {
  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(1rem, 2.4vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  box-sizing: border-box;
}

/* Protection Score Meter */
.bv12-meter-bar {
  background: linear-gradient(90deg, #F5F0E8 0%, #EEF4FB 100%);
  border: 1px solid rgba(13, 59, 110, 0.12);
  border-radius: 16px;
  padding: 0.9rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bv12-meter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bv12-meter-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: #0D3B6E;
  font-size: 0.95rem;
  line-height: 1.35;
}

.bv12-status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #0B6B52;
  flex: 0 0 auto;
  transition: background-color 0.25s ease;
}

.bv12-card[data-bv12-score="3"] .bv12-status-dot,
.bv12-card[data-bv12-score="2"] .bv12-status-dot {
  background: #D4A017;
}

.bv12-card[data-bv12-score="1"] .bv12-status-dot,
.bv12-card[data-bv12-score="0"] .bv12-status-dot {
  background: #9A2B1D;
}

.bv12-meter-label {
  font-weight: 600;
  color: #334155;
}

.bv12-meter-val {
  font-weight: 800;
  color: #0D3B6E;
}

.bv12-meter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bv12-preset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid #0D3B6E;
  background: #FFFFFF;
  color: #0D3B6E;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.bv12-preset-btn:hover:not(:disabled) {
  background: #0D3B6E;
  color: #FFFFFF;
}

.bv12-preset-restore:not(:disabled) {
  background: #0B6B52;
  border-color: #0B6B52;
  color: #FFFFFF;
}

.bv12-preset-restore:hover:not(:disabled) {
  background: #08523E;
  border-color: #08523E;
}

.bv12-preset-btn:disabled {
  opacity: 0.48;
  cursor: default;
}

.bv12-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(13, 59, 110, 0.12);
  overflow: hidden;
}

.bv12-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0B6B52 0%, #1565A8 100%);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}

.bv12-card[data-bv12-score="3"] .bv12-fill {
  transform: scaleX(0.75);
  background: linear-gradient(90deg, #1565A8 0%, #D4A017 100%);
}

.bv12-card[data-bv12-score="2"] .bv12-fill {
  transform: scaleX(0.5);
  background: linear-gradient(90deg, #D4A017 0%, #B45309 100%);
}

.bv12-card[data-bv12-score="1"] .bv12-fill {
  transform: scaleX(0.25);
  background: #9A2B1D;
}

.bv12-card[data-bv12-score="0"] .bv12-fill {
  transform: scaleX(0.04);
  background: #9A2B1D;
}

/* Locked Aspect-Ratio Stage (CLS = 0.000) */
.bv12-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 380;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(13, 59, 110, 0.14);
  background: #EEF4FB;
}

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

/* SVG Live Layer Visibility */
.bv12-layer {
  transition: opacity 0.28s ease;
}

.bv12-layer-gl-off,
.bv12-layer-tools-off,
.bv12-layer-auto-off,
.bv12-layer-wc-off {
  opacity: 0;
  pointer-events: none;
}

.bv12-stage.bv12-off-gl .bv12-layer-gl-on { opacity: 0; }
.bv12-stage.bv12-off-gl .bv12-layer-gl-off { opacity: 1; }

.bv12-stage.bv12-off-tools .bv12-layer-tools-on { opacity: 0; }
.bv12-stage.bv12-off-tools .bv12-layer-tools-off { opacity: 1; }

.bv12-stage.bv12-off-auto .bv12-layer-auto-on { opacity: 0; }
.bv12-stage.bv12-off-auto .bv12-layer-auto-off { opacity: 1; }

.bv12-stage.bv12-off-wc .bv12-layer-wc-on { opacity: 0; }
.bv12-stage.bv12-off-wc .bv12-layer-wc-off { opacity: 1; }

/* GPU-Composited Ambient Animations */
@keyframes bv12-current-flow {
  from { stroke-dashoffset: 36; }
  to { stroke-dashoffset: 0; }
}

@keyframes bv12-pulse-ring {
  0%, 100% { opacity: 0.45; transform: scale(0.95); }
  50% { opacity: 0.9; transform: scale(1.06); }
}

@keyframes bv12-arc-flicker {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.72; }
  52% { opacity: 1; }
  76% { opacity: 0.82; }
}

@keyframes bv12-smoke-drift {
  0%, 100% { transform: translateY(0); opacity: 0.72; }
  50% { transform: translateY(-4px); opacity: 0.42; }
}

.bv12-wire-flow {
  animation: bv12-current-flow 2.4s linear infinite;
}

.bv12-stage.bv12-off-gl .bv12-wire-flow {
  stroke: #D94E28;
  animation-duration: 0.9s;
}

.bv12-hazard-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: bv12-pulse-ring 2s ease-in-out infinite;
}

.bv12-arc-bolt {
  animation: bv12-arc-flicker 1.3s ease-in-out infinite;
}

.bv12-smoke {
  animation: bv12-smoke-drift 2.6s ease-in-out infinite;
}

.bv12-root-paused .bv12-wire-flow,
.bv12-root-paused .bv12-hazard-pulse,
.bv12-root-paused .bv12-arc-bolt,
.bv12-root-paused .bv12-smoke {
  animation-play-state: paused !important;
}

/* 4-Switch Control Deck */
.bv12-toggles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

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

@media (max-width: 540px) {
  .bv12-toggles {
    grid-template-columns: 1fr;
  }
}

.bv12-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.42rem;
  min-width: 0;
  min-height: 44px;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 2px solid rgba(11, 107, 82, 0.35);
  background: #F4FBF8;
  color: #0D3B6E;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease;
}

.bv12-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -12px rgba(13, 59, 110, 0.32);
}

.bv12-toggle[aria-pressed="false"] {
  border-color: rgba(154, 43, 29, 0.45);
  background: #FFF6F4;
}

.bv12-toggle-top {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.bv12-toggle-name {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0D3B6E;
}

.bv12-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #0B6B52;
  transition: background-color 0.22s ease;
}

.bv12-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(13, 59, 110, 0.3);
  transform: translateX(20px);
  transition: transform 0.22s ease;
}

.bv12-toggle[aria-pressed="false"] .bv12-switch {
  background: #9A2B1D;
}

.bv12-toggle[aria-pressed="false"] .bv12-knob {
  transform: translateX(0);
}

.bv12-toggle-meta {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #334155;
}

.bv12-toggle-state {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: #0B6B52;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bv12-toggle[aria-pressed="false"] .bv12-toggle-state {
  background: #9A2B1D;
  color: #FFFFFF;
}

/* Plain-English Readout Card */
.bv12-readout {
  border-radius: 18px;
  border: 1px solid rgba(11, 107, 82, 0.26);
  background: linear-gradient(135deg, #F3FBF8 0%, #EEF4FB 100%);
  padding: 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bv12-readout[data-bv12-mode="warn"] {
  border-color: rgba(212, 160, 23, 0.55);
  background: linear-gradient(135deg, #FDF8EA 0%, #FFF6F4 100%);
}

.bv12-readout[data-bv12-mode="alert"] {
  border-color: rgba(154, 43, 29, 0.42);
  background: #FFF5F3;
}

.bv12-readout-badge {
  align-self: flex-start;
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  background: #0B6B52;
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bv12-readout[data-bv12-mode="warn"] .bv12-readout-badge {
  background: #D4A017;
  color: #0D3B6E;
}

.bv12-readout[data-bv12-mode="alert"] .bv12-readout-badge {
  background: #9A2B1D;
  color: #FFFFFF;
}

.bv12-readout-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
  color: #0D3B6E;
}

.bv12-readout-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #1E293B;
}

.bv12-gap-list {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 680px) {
  .bv12-gap-list {
    grid-template-columns: 1fr;
  }
}

.bv12-gap-item {
  background: #FFFFFF;
  border: 1px solid rgba(154, 43, 29, 0.25);
  border-left: 4px solid #9A2B1D;
  border-radius: 10px;
  padding: 0.6rem 0.78rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #1E293B;
}

.bv12-gap-item strong {
  display: block;
  color: #9A2B1D;
  font-weight: 800;
  margin-bottom: 0.14rem;
}
