:root {
  font-family: Roboto, Arial, sans-serif;
  color: #0b1724;
  background: #f7f8f8;
}

html {
  scroll-behavior: smooth;
}

.ruhl-back-link {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 55, 90, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(0, 55, 90, 0.12);
  color: #00375a;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ruhl-back-link:hover {
  background: #00375a;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 55, 90, 0.2);
  transform: translateY(-1px);
}

.ruhl-back-link:focus-visible {
  outline: 3px solid rgba(252, 190, 0, 0.55);
  outline-offset: 3px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUpCompact {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.in-view {
  animation: fadeUp 0.72s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Mobile + tablet only (desktop 1024px+ unchanged) */
@media (max-width: 1023px) {
  main {
    overflow-x: clip;
  }

  .reveal {
    transform: translateY(10px);
  }

  .reveal.in-view {
    animation-name: fadeUpCompact;
    animation-duration: 0.72s;
    animation-timing-function: ease;
    animation-fill-mode: both;
  }

  [data-animate-number] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
  }

  .co2-chart-wrap,
  .waterfall-chart-wrap {
    contain: layout style;
  }

  .hero-eyebrow {
    letter-spacing: 0.18em;
    font-size: 0.6875rem;
    line-height: 1.5;
  }

  .hero-title {
    line-height: 1.05;
  }

  .hero-cta-group {
    width: 100%;
  }

  .hero-cta-group a {
    min-height: 44px;
    width: 100%;
  }

  .pressure-callout {
    font-size: clamp(1.25rem, 4vw, 1.875rem);
    line-height: 1.35;
  }

  .implementation-timeline {
    padding-left: 3.25rem;
    margin-left: 0.5rem;
  }

  .timeline-step-badge {
    left: -3rem !important;
  }

  .co2-chart-wrap {
    overflow: hidden;
  }

  #co2-chart {
    min-width: 0 !important;
    width: 100%;
    height: auto !important;
    aspect-ratio: 1200 / 585;
    min-height: 280px;
  }

  #co2-chart svg {
    display: block;
    overflow: visible;
  }

  .waterfall-chart-wrap {
    overflow: hidden;
    container-type: inline-size;
  }

  .waterfall-chart-scale {
    height: calc(510px * (100cqw / 1120px));
    isolation: isolate;
  }

  .waterfall-chart-inner {
    width: 1120px;
    min-width: 1120px;
    transform: scale(calc(100cqw / 1120px));
    transform-origin: top left;
    backface-visibility: hidden;
  }

  .wf-bar {
    backface-visibility: hidden;
  }

  .wf-bar.is-animating {
    will-change: transform;
  }

  .energy-data-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .energy-data-row strong {
    word-break: break-word;
  }

  .energy-axis {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem 1rem;
    row-gap: 0.35rem;
  }

  .energy-axis span {
    flex: 0 0 auto;
  }

  #airflow-charts .flex.justify-between.text-sm {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  #airflow-charts .flex.justify-between.text-sm strong {
    word-break: break-word;
  }

  #airflow-charts [data-animate-width] {
    transform: translateZ(0);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .hero-cta-group {
    width: auto;
  }

  .hero-cta-group a {
    width: auto;
  }
}

@media (max-width: 767px) {
  .hero-eyebrow {
    letter-spacing: 0.14em;
  }

  .page-section-y {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .page-section-y-lg {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  /* Page gutters (mobile only; tablet keeps px-6 / md:px-10) */
  main .max-w-7xl {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .org-partner-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  .org-partner-grid img {
    max-width: 100%;
    height: auto;
  }

  .btn-learn-more {
    align-self: stretch;
    width: 100%;
    justify-content: center;
  }

  /* CO₂ + waterfall: native size + horizontal scroll for readability */
  .waterfall-chart-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
    contain: none;
  }

  .co2-chart-wrap {
    overflow: hidden;
    contain: none;
  }

  .co2-chart-wrap::-webkit-scrollbar,
  .waterfall-chart-wrap::-webkit-scrollbar {
    height: 8px;
  }

  .co2-chart-wrap::-webkit-scrollbar-track,
  .waterfall-chart-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 9999px;
  }

  .co2-chart-wrap::-webkit-scrollbar-thumb,
  .waterfall-chart-wrap::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 9999px;
  }

  #co2-chart {
    min-width: 0 !important;
    width: 100%;
    height: auto !important;
    aspect-ratio: 1200 / 585;
    min-height: 280px;
  }

  .waterfall-chart-scale {
    position: relative;
    width: 560px;
    height: 255px;
    isolation: auto;
    overflow: hidden;
    flex-shrink: 0;
  }

  .waterfall-chart-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 1120px;
    min-width: 1120px;
    height: 510px;
    transform: scale(0.5);
    transform-origin: top left;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .page-section-y {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .page-section-y-lg {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

/* Future building / parallax scene hooks (tablet + mobile) */
@media (max-width: 1023px) {
  .building-scene,
  .building-stage {
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .building-scene img,
  .building-stage img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    backface-visibility: hidden;
  }
}

@media (min-width: 1024px) {
  .hero-section {
    box-sizing: border-box;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero-section .hero-section-inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: clamp(2rem, 4vh, 3.5rem) !important;
    padding-bottom: clamp(2rem, 4vh, 3.5rem) !important;
  }

  .hero-section .hero-stats {
    margin-top: clamp(2rem, 4vh, 3.5rem) !important;
  }
}

/* 3D building scroll section */
.building-scroll-section {
  position: relative;
  width: 100%;
  height: 260vh;
  background: linear-gradient(180deg, #dce6ee 0%, #eef2f5 46%, #f7f8f8 100%);
}

.building-scroll-section.is-reduced-motion {
  height: 100vh;
  height: 100dvh;
}

.building-scroll-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #dce6ee 0%, #eef2f5 46%, #f7f8f8 100%);
}

.building-scroll-canvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.building-scroll-canvas.is-roof-draggable {
  cursor: grab;
}

.building-scroll-canvas.is-roof-dragging {
  cursor: grabbing;
  touch-action: none;
}

.building-scroll-side-story {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 32vw) minmax(0, 1fr);
  align-items: start;
  gap: 0 0.5rem;
  padding: clamp(1.25rem, 3.5vh, 2.75rem) clamp(0.75rem, 2vw, 1.5rem)
    clamp(1rem, 2vh, 1.75rem);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s linear, visibility 0.12s linear;
}

.building-scroll-side-header {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 1;
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem clamp(2.5rem, 8vh, 5rem);
  text-align: center;
}

.building-scroll-side-header > * {
  position: relative;
  z-index: 1;
}

.building-scroll-side-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  grid-row: 2;
  max-height: min(calc(100vh - 14rem), 42rem);
  overflow: hidden;
  justify-self: center;
  align-self: start;
  margin-top: clamp(0.75rem, 2.5vh, 1.75rem);
}

.building-scroll-side-col--left {
  grid-column: 1;
  max-width: min(20rem, 100%);
}

.building-scroll-side-col--right {
  grid-column: 3;
  max-width: min(20rem, 100%);
}

.building-scroll-side-eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #00375a;
}

.building-scroll-side-title {
  margin: 0.75rem 0 0;
  font-size: clamp(1.875rem, 3.2vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #00375a;
}

.building-scroll-side-lead {
  display: inline-block;
  margin: 1rem auto 0;
  max-width: 48rem;
  padding: 0 0.35rem;
  border-radius: 0.45rem;
  background: rgba(231, 239, 245, 0.96);
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: #475569;
}

.building-scroll-side-pillars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.building-scroll-side-pillar {
  margin: 0;
  padding: 1.25rem 1rem;
  border-radius: 2rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  text-align: center;
}

.building-scroll-side-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto;
  border-radius: 999px;
  background: #00375a;
  color: #fcbe00;
}

.building-scroll-side-pillar h3 {
  margin: 1rem 0 0;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.3;
  color: #00375a;
}

.building-scroll-side-pillar p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.625;
  color: #475569;
}

.building-scroll-side-callout {
  padding: 1.25rem 1.35rem;
  border-radius: 2rem;
}

.building-scroll-side-callout h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.25;
}

.building-scroll-side-callout p {
  margin: 0.85rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.625;
}

.building-scroll-side-callout--challenge {
  background: #00375a;
  color: #fff;
}

.building-scroll-side-callout--challenge p {
  color: rgba(255, 255, 255, 0.82);
}

.building-scroll-side-callout--solution {
  background: #fcbe00;
  color: #00375a;
}

@media (max-width: 1100px) {
  .building-scroll-side-story {
    display: none;
  }
}

@media (min-width: 1101px) and (max-width: 1280px) {
  .building-scroll-side-story {
    grid-template-columns: minmax(0, 1fr) minmax(7rem, 38vw) minmax(0, 1fr);
  }

  .building-scroll-side-col--left,
  .building-scroll-side-col--right {
    max-width: min(16rem, 100%);
  }
}

.building-scroll-status {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  margin: 0;
  max-width: min(28rem, calc(100% - 2rem));
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #475569;
}

.building-scroll-status.is-hidden {
  display: none;
}

.building-scroll-status.is-error {
  color: #991b1b;
}

.building-scroll-section.is-blocked .building-scroll-status {
  color: #991b1b;
}

.building-scroll-overlay.is-disabled {
  display: none !important;
}

.building-scroll-overlay {
  pointer-events: none;
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 1.5rem 1.5rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(247, 248, 248, 0) 0%, rgba(247, 248, 248, 0.92) 72%);
}

.building-scroll-eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #00375a;
}

.building-scroll-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #00375a;
}

.building-scroll-hint {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #475569;
}

@media (min-width: 768px) {
  .building-scroll-section {
    height: 260vh;
  }

  .building-scroll-overlay {
    padding: 2rem 2.5rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .building-scroll-section {
    height: 100vh;
    height: 100dvh;
  }
}

.building-scroll-rooftop-ui {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
}

.building-rooftop-entry-btn {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #00375a;
  box-shadow: 0 14px 36px rgba(0, 55, 90, 0.24), 0 0 0 6px rgba(255, 255, 255, 0.46);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.6rem);
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.building-rooftop-entry-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.building-rooftop-entry-btn.is-docked {
  position: absolute;
}

.building-rooftop-entry-btn:hover {
  background: #005f8f;
  box-shadow: 0 18px 42px rgba(0, 55, 90, 0.3), 0 0 0 7px rgba(255, 255, 255, 0.54);
  color: #ffffff;
}

.building-rooftop-entry-btn:focus-visible {
  outline: 3px solid rgba(0, 95, 143, 0.32);
  outline-offset: 4px;
}

.building-scroll-canvas.is-rooftop-mode,
.building-scroll-sticky.is-rooftop-mode {
  position: fixed;
  inset: 0;
  z-index: 55;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.rooftop-detail-section {
  position: fixed;
  inset: 0;
  z-index: 60;
  height: 100vh;
  height: 100dvh;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.rooftop-detail-section.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.rooftop-detail-section.is-open .rooftop-detail-back-link,
.rooftop-detail-section.is-open .rooftop-detail-controls,
.rooftop-detail-section.is-open .rooftop-roof-legend.is-visible {
  pointer-events: auto;
}

body.is-rooftop-detail-open {
  overflow: hidden;
}

.rooftop-detail-sticky {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.rooftop-detail-sticky > * {
  pointer-events: none;
}

.rooftop-detail-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 18;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  max-width: min(100% - 2rem, 20rem);
}

.rooftop-detail-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 55, 90, 0.14);
  box-shadow: 0 6px 18px rgba(0, 55, 90, 0.1);
  color: #00375a;
  font-size: 0.625rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.rooftop-detail-reset-btn:hover {
  background: #00375a;
  color: #ffffff;
}

.rooftop-detail-back-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 18;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 55, 90, 0.14);
  box-shadow: 0 6px 18px rgba(0, 55, 90, 0.1);
  color: #00375a;
  font-size: 0.625rem;
  font-weight: 800;
  cursor: pointer;
}

.rooftop-detail-back-link:hover {
  background: #00375a;
  color: #ffffff;
}

.rooftop-approach-panel.is-disabled {
  display: none !important;
}

.rooftop-approach-panel {
  position: absolute;
  top: 1.25rem;
  left: 1rem;
  max-width: min(22rem, calc(100% - 2rem));
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 55, 90, 0.12);
  box-shadow: 0 12px 40px rgba(0, 55, 90, 0.08);
}

.rooftop-approach-eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #00375a;
}

.rooftop-approach-title {
  margin: 0.45rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 900;
  line-height: 1.25;
  color: #00375a;
}

.rooftop-approach-states {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.rooftop-approach-state {
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.rooftop-approach-state strong {
  display: block;
  font-size: 0.8125rem;
  color: #00375a;
}

.rooftop-approach-state span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #475569;
}

.rooftop-approach-state.is-active {
  background: rgba(252, 190, 0, 0.14);
  border-color: rgba(0, 55, 90, 0.14);
}

.rooftop-enabled-by {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 55, 90, 0.1);
}

.rooftop-enabled-by-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #00375a;
}

.rooftop-enabled-by ul {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #475569;
}

.rooftop-flow-legend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  max-width: min(14rem, calc(100% - 2rem));
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 55, 90, 0.12);
  box-shadow: 0 8px 24px rgba(0, 55, 90, 0.08);
}

.rooftop-flow-legend-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #00375a;
}

.rooftop-flow-legend ul {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.rooftop-flow-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.3rem 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
}

.rooftop-flow-swatch {
  width: 0.75rem;
  height: 0.2rem;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 55, 90, 0.08);
}

.rooftop-how-it-works.is-disabled {
  display: none !important;
}

.rooftop-how-it-works {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  max-width: min(16rem, calc(100% - 2rem));
  padding: 0.75rem 0.85rem 0.8rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 55, 90, 0.12);
  box-shadow: 0 8px 24px rgba(0, 55, 90, 0.08);
}

.rooftop-how-it-works-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #00375a;
}

.rooftop-how-it-works ol {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.rooftop-how-it-works li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.625rem;
  line-height: 1.35;
  color: #475569;
}

.rooftop-how-it-works li strong {
  display: block;
  font-size: 0.625rem;
  font-weight: 800;
  color: #00375a;
}

.rooftop-how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 900;
  color: #0f172a;
  background: #4ade80;
}

.rooftop-flow-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9;
}

.rooftop-flow-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.3rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  white-space: nowrap;
}

.rooftop-flow-tag.is-visible {
  opacity: 1;
  visibility: visible;
}

.rooftop-label-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 15;
}

.rooftop-roof-legend {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 13;
}

.rooftop-roof-legend.is-visible {
  opacity: 1;
  visibility: visible;
}

.rooftop-roof-legend-flows {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 55, 90, 0.1);
}

.rooftop-roof-legend-flows p {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0 0;
  font-size: 0.625rem;
  font-weight: 700;
  color: #475569;
}

.rooftop-label-callout {
  position: absolute;
  z-index: 12;
  width: 11.5rem;
  max-width: min(11.5rem, 52vw);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%);
  transition: opacity 0.22s ease, visibility 0.22s ease;
  pointer-events: none;
  touch-action: none;
  user-select: none;
}

.rooftop-label-callout.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.rooftop-label-layer.is-editing .rooftop-label-callout.is-visible {
  pointer-events: auto;
  cursor: grab;
}

.rooftop-label-layer.is-editing .rooftop-label-card {
  cursor: grab;
}

.rooftop-label-layer.is-editing .rooftop-label-card::after {
  content: 'Drag';
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  pointer-events: none;
}

.rooftop-label-callout.is-dragging {
  transition: none;
  cursor: grabbing;
  z-index: 25;
}

.rooftop-label-callout.is-dragging .rooftop-label-card {
  border-color: rgba(0, 55, 90, 0.28);
  box-shadow: 0 10px 28px rgba(0, 55, 90, 0.18);
}

.rooftop-label-leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 11;
}

.rooftop-flow-paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 10;
}

.rooftop-flow-paths.is-editing {
  pointer-events: auto;
}

.rooftop-flow-paths.is-editing .rooftop-flow-path.is-visible {
  pointer-events: stroke;
  cursor: crosshair;
}

.rooftop-flow-waypoint-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 13;
}

.rooftop-flow-waypoint-layer.is-editing {
  pointer-events: none;
}

.rooftop-flow-waypoint-handle {
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  margin: -0.45rem 0 0 -0.45rem;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: grab;
  touch-action: none;
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.12s ease;
}

.rooftop-flow-waypoint-handle.is-exhaust {
  background: #e53935;
}

.rooftop-flow-waypoint-handle.is-supply {
  background: #66ff33;
}

.rooftop-flow-waypoint-handle.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rooftop-flow-waypoint-handle.is-dragging,
.rooftop-flow-waypoint-handle:hover {
  transform: scale(1.18);
  cursor: grabbing;
}

.rooftop-flow-layout-toolbar {
  top: auto;
  bottom: 0.75rem;
  right: 0.75rem;
}

.is-roof-flow-editing .building-scroll-canvas.is-roof-draggable {
  cursor: grab;
}

.rooftop-flow-path {
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 5 11;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.rooftop-flow-path.is-visible {
  visibility: visible;
}

.rooftop-flow-path.is-exhaust {
  animation: rooftop-flow-march-exhaust 2.8s linear infinite;
}

.rooftop-flow-path.is-supply {
  animation: rooftop-flow-march-supply 2.4s linear infinite;
}

@keyframes rooftop-flow-march-exhaust {
  to {
    stroke-dashoffset: -32;
  }
}

@keyframes rooftop-flow-march-supply {
  to {
    stroke-dashoffset: -32;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rooftop-flow-path.is-exhaust,
  .rooftop-flow-path.is-supply {
    animation: none;
    stroke-dasharray: none;
    opacity: 0.42;
  }
}

.rooftop-label-line {
  stroke: #00375a;
  stroke-width: 1.5;
  stroke-opacity: 0.55;
  fill: none;
  marker-end: url(#rooftop-label-arrow);
}

.rooftop-label-card {
  position: relative;
  padding: 0.45rem 0.5rem 0.5rem 1.35rem;
  border-radius: 0.5rem;
  background: #ffffff;
  border: 1px solid rgba(0, 55, 90, 0.16);
  box-shadow: 0 6px 20px rgba(0, 55, 90, 0.12);
}

.rooftop-label-swatch {
  position: absolute;
  top: 0.5rem;
  left: 0.45rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 0.125rem;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.rooftop-label-badge {
  display: none;
}

.rooftop-label-index {
  display: none;
}

.rooftop-label-card strong {
  display: block;
  font-size: 0.625rem;
  font-weight: 900;
  line-height: 1.25;
  color: #00375a;
}

.rooftop-label-body {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.5625rem;
  line-height: 1.35;
  color: #475569;
}

.rooftop-label-anchor-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 14;
}

.rooftop-label-anchor-handle {
  position: absolute;
  width: 0.875rem;
  height: 0.875rem;
  margin: -0.4375rem 0 0 -0.4375rem;
  padding: 0;
  border: 2px solid #00375a;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 55, 90, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: grab;
  touch-action: none;
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.12s ease;
}

.rooftop-label-anchor-handle.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rooftop-label-anchor-handle.is-dragging,
.rooftop-label-anchor-handle:hover {
  transform: scale(1.15);
  cursor: grabbing;
  background: #e8f4fc;
}

.rooftop-label-layout-toolbar {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 16;
  width: min(15rem, calc(100% - 1.5rem));
  padding: 0.65rem 0.75rem;
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 55, 90, 0.14);
  box-shadow: 0 8px 24px rgba(0, 55, 90, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.rooftop-label-layout-toolbar.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rooftop-label-layout-toolbar-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #00375a;
}

.rooftop-label-layout-toolbar-copy {
  margin: 0.35rem 0 0;
  font-size: 0.625rem;
  line-height: 1.35;
  color: #475569;
}

.rooftop-label-layout-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.rooftop-label-layout-btn {
  appearance: none;
  border: 1px solid rgba(0, 55, 90, 0.2);
  border-radius: 999px;
  background: #00375a;
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.rooftop-label-layout-btn.is-muted {
  background: #ffffff;
  color: #00375a;
}

.rooftop-label-layout-toolbar-status {
  min-height: 1rem;
  margin: 0.45rem 0 0;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #0f766e;
}

.is-roof-label-editing .building-scroll-canvas.is-roof-draggable {
  cursor: grab;
}

@media (max-width: 767px) {
  .rooftop-how-it-works {
    display: none;
  }

  .rooftop-roof-legend {
    display: block;
    max-width: min(11.5rem, calc(100% - 1.25rem));
    left: 0.55rem;
    bottom: 0.55rem;
    padding: 0.6rem 0.7rem;
  }

  .rooftop-roof-legend-flows {
    display: none;
  }

  .rooftop-flow-tag {
    font-size: 0.5rem;
    max-width: 6.5rem;
    white-space: normal;
    text-align: center;
  }

  .rooftop-label-layer > .rooftop-label-callout:nth-child(n + 9) {
    display: none;
  }

  .rooftop-label-body {
    display: none;
  }
}
