/* cv15.css — Cornerstone Insurance Group: Food Trucks (Archetype A6: Live Layer Toggle Simulator)
   Inland Piedmont Architectural Blueprint aesthetic. Strict cv15- scoping, WCAG 2.2 AA, zero CLS. */

.cv15-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* Telemetry Score Bar */
.cv15-telemetry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.25rem;
  background: #FFFFFF;
  border: 1.5px solid rgba(10, 26, 51, 0.22);
  border-left: 5px solid #1C4A75;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 10px 26px -18px rgba(10, 26, 51, 0.22);
  min-width: 0;
}

.cv15-shell[data-gaps="true"] .cv15-telemetry {
  border-left-color: #F26822;
}

.cv15-score-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* Signature 3-slab Cornerstone keystone mark */
.cv15-keystone {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 24px;
  flex: 0 0 auto;
}
.cv15-keystone span {
  display: block;
  height: 5px;
  border-radius: 1px;
  background: #1C4A75;
}
.cv15-keystone span:nth-child(1) { width: 100%; background: #0A1A33; }
.cv15-keystone span:nth-child(2) { width: 78%; background: #2E72AC; }
.cv15-keystone span:nth-child(3) { width: 58%; background: #F26822; }

.cv15-score-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.cv15-score-k {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #475569;
}

.cv15-score-val {
  font-size: 1rem;
  font-weight: 800;
  color: #0A1A33;
}

.cv15-meter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  flex: 1 1 200px;
  max-width: 22rem;
  min-width: 140px;
}

.cv15-seg {
  display: block;
  height: 12px;
  border-radius: 3px;
  background: #EFF2F5;
  border: 1.5px solid #B5420B;
  transition: background-color 0.22s ease, border-color 0.22s ease;
}

.cv15-seg.is-on {
  background: #1C4A75;
  border-color: #0A1A33;
}

.cv15-reset {
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  border: 2px solid #0A1A33;
  background: #F26822;
  color: #0A1A33;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.cv15-reset:hover {
  background: #0A1A33;
  color: #FFFFFF;
}

.cv15-reset[hidden] {
  display: none;
}

/* Blueprint SVG Stage — locked aspect-ratio for zero CLS */
.cv15-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 380;
  border-radius: 8px;
  overflow: hidden;
  background: #0A1A33;
  border: 2px solid #0A1A33;
  box-shadow: 0 2px 4px rgba(10, 26, 51, 0.08), 0 18px 38px -18px rgba(10, 26, 51, 0.34);
}

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

/* Real-time SVG layer visibility driven by root data attributes (pure GPU opacity) */
.cv15-layer {
  transition: opacity 0.24s ease;
}

.cv15-shell[data-auto="on"] .cv15-layer--auto-on,
.cv15-shell[data-auto="off"] .cv15-layer--auto-off,
.cv15-shell[data-kitchen="on"] .cv15-layer--kitchen-on,
.cv15-shell[data-kitchen="off"] .cv15-layer--kitchen-off,
.cv15-shell[data-gl="on"] .cv15-layer--gl-on,
.cv15-shell[data-gl="off"] .cv15-layer--gl-off,
.cv15-shell[data-coi="on"] .cv15-layer--coi-on,
.cv15-shell[data-coi="off"] .cv15-layer--coi-off {
  opacity: 1;
}

.cv15-shell[data-auto="off"] .cv15-layer--auto-on,
.cv15-shell[data-auto="on"] .cv15-layer--auto-off,
.cv15-shell[data-kitchen="off"] .cv15-layer--kitchen-on,
.cv15-shell[data-kitchen="on"] .cv15-layer--kitchen-off,
.cv15-shell[data-gl="off"] .cv15-layer--gl-on,
.cv15-shell[data-gl="on"] .cv15-layer--gl-off,
.cv15-shell[data-coi="off"] .cv15-layer--coi-on,
.cv15-shell[data-coi="on"] .cv15-layer--coi-off {
  opacity: 0;
  pointer-events: none;
}

/* Ambient blueprint animations (only run while in-view and not paused) */
.cv15-sec.cv15-inview .cv15-transit-flow {
  animation: cv15-flow 2.8s linear infinite;
}
.cv15-sec.cv15-inview .cv15-arch-flow {
  animation: cv15-flow-arch 4s linear infinite;
}
.cv15-sec.cv15-inview .cv15-warn-pulse {
  animation: cv15-warn 1.9s ease-in-out infinite;
}

@keyframes cv15-flow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -44; }
}
@keyframes cv15-flow-arch {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -30; }
}
@keyframes cv15-warn {
  0%, 100% { opacity: 0.68; }
  50% { opacity: 1; }
}

/* 4 Architectural Multi-Toggle Rocker Controls */
.cv15-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.cv15-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  min-height: 68px;
  min-width: 0;
  text-align: left;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(10, 26, 51, 0.24);
  border-left: 5px solid #1C4A75;
  background: #FFFFFF;
  color: #0A1A33;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(10, 26, 51, 0.05);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.cv15-toggle:hover {
  background: #F4F7FA;
  border-color: #0A1A33;
}

.cv15-toggle:not(.is-on) {
  background: #FEF1EA;
  border-color: rgba(181, 66, 11, 0.42);
  border-left-color: #F26822;
}

.cv15-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}

.cv15-code {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #1C4A75;
}

.cv15-toggle:not(.is-on) .cv15-code {
  color: #B5420B;
}

.cv15-name {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0A1A33;
}

.cv15-desc {
  font-size: 0.84rem;
  line-height: 1.4;
  color: #334155;
}

.cv15-switch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.26rem;
  flex: 0 0 auto;
}

.cv15-switch-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #1C4A75;
  color: #FFFFFF;
}

.cv15-toggle:not(.is-on) .cv15-switch-lbl {
  background: #F26822;
  color: #0A1A33;
}

.cv15-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 24px;
  border-radius: 4px;
  background: #CBD5E1;
  border: 1.5px solid #0A1A33;
  padding: 2px;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

.cv15-toggle.is-on .cv15-switch-track {
  background: #1C4A75;
}

.cv15-switch-thumb {
  width: 18px;
  height: 16px;
  border-radius: 2px;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(10, 26, 51, 0.32);
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.cv15-toggle.is-on .cv15-switch-thumb {
  transform: translateX(22px);
}

/* Dynamic Plain-English Gap Readout */
.cv15-readout {
  background: #FFFFFF;
  border: 1.5px solid rgba(10, 26, 51, 0.22);
  border-top: 4px solid #1C4A75;
  border-radius: 8px;
  padding: clamp(1.1rem, 2.4vw, 1.55rem);
  box-shadow: 0 14px 30px -20px rgba(10, 26, 51, 0.22);
  min-width: 0;
}

.cv15-readout[data-status="gap"] {
  border-top-color: #F26822;
  background: linear-gradient(180deg, #FEF8F4 0%, #FFFFFF 100%);
}

.cv15-readout-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.65rem;
}

.cv15-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.26rem 0.72rem;
  border-radius: 4px;
  background: #1C4A75;
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cv15-readout[data-status="gap"] .cv15-status-pill {
  background: #F26822;
  color: #0A1A33;
}

.cv15-policy-note {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1C4A75;
}

.cv15-readout[data-status="gap"] .cv15-policy-note {
  color: #B5420B;
}

.cv15-readout-title {
  margin: 0 0 0.42rem;
  font-size: clamp(1.12rem, 1.9vw, 1.38rem);
  font-weight: 800;
  line-height: 1.24;
  color: #0A1A33;
}

.cv15-readout-summary {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.58;
  color: #334155;
  max-width: 72ch;
}

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

.cv15-gap-item {
  padding: 0.72rem 0.88rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.48;
  color: #1E293B;
  border: 1px solid rgba(10, 26, 51, 0.14);
  background: #F4F7FA;
  border-left: 4px solid #1C4A75;
}

.cv15-gap-item.is-gap {
  background: #FEF1EA;
  border-color: rgba(181, 66, 11, 0.34);
  border-left-color: #F26822;
}

.cv15-gap-item.is-gap strong {
  color: #B5420B;
}

.cv15-gap-item.is-safe strong {
  color: #0A1A33;
}

@media (max-width: 780px) {
  .cv15-toggles,
  .cv15-gap-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .cv15-telemetry {
    padding: 0.75rem 0.85rem;
  }
  .cv15-toggle {
    padding: 0.72rem 0.8rem;
    gap: 0.6rem;
  }
}
