/* ECS Engineering: dimostrazione interattiva, isolata dalla UI editoriale condivisa. */

.ecs-demo {
  --ecs-green: #3aaa35;
  --ecs-green-bright: #63ce5e;
  --ecs-blue: #0076b9;
  --ecs-cyan: #65d7df;
  --ecs-navy: #06192d;
  --ecs-navy-soft: #0a223c;
  --ecs-panel: #0b2946;
  --ecs-white: #f7fbff;
  --ecs-text-soft: #bcd4e2;
  --ecs-line: rgba(203, 232, 246, 0.17);
  --ecs-warning: #f2b936;

  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 9vw, 9rem) var(--gutter);
  color: var(--ecs-white);
  background:
    linear-gradient(rgba(6, 25, 45, 0.46), rgba(6, 25, 45, 0.46)),
    linear-gradient(108deg, #3aaa35 0%, #168d77 47%, #0076b9 100%);
}

.ecs-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ecs-demo__intro {
  display: grid;
  width: min(100%, var(--content-max));
  margin: 0 auto clamp(3rem, 6vw, 5.5rem);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 2rem);
  align-items: end;
}

.ecs-demo__title {
  max-width: 10.5ch;
  margin: 0;
  grid-column: 1 / 8;
  font-size: clamp(3rem, 6vw, 5.75rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 0.96;
  text-wrap: balance;
}

.ecs-demo__intro-copy {
  max-width: 36rem;
  grid-column: 9 / -1;
}

.ecs-demo__intro-copy > p:first-child {
  margin: 0;
  color: rgba(247, 251, 255, 0.92);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.65;
}

.ecs-demo__disclaimer {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  margin: 1.6rem 0 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.ecs-demo__disclaimer svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.ecs-dashboard {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  overflow: hidden;
  color: var(--ecs-white);
  border: 1px solid rgba(236, 250, 255, 0.24);
  background: var(--ecs-navy);
  font-variant-numeric: tabular-nums;
}

.ecs-dashboard button {
  border-radius: 0;
}

.ecs-dashboard button:focus-visible {
  outline: 3px solid var(--ecs-white);
  outline-offset: -3px;
  box-shadow: 0 0 0 5px var(--ecs-blue);
}

.ecs-dashboard__toolbar {
  display: flex;
  min-height: 5.5rem;
  padding: 1.25rem clamp(1.25rem, 2vw, 2rem);
  border-bottom: 1px solid var(--ecs-line);
  background: #081f37;
  align-items: center;
  justify-content: space-between;
}

.ecs-dashboard__brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.ecs-dashboard__logo {
  display: block;
  width: clamp(10.5rem, 14vw, 12.5rem);
  height: auto;
}

.ecs-dashboard__brand-context {
  max-width: 9rem;
  padding-left: 1rem;
  border-left: 1px solid var(--ecs-line);
  color: var(--ecs-text-soft);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.075em;
  line-height: 1.35;
  text-transform: uppercase;
}

.ecs-dashboard__connection {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  color: var(--ecs-text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.ecs-dashboard__live {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--ecs-white);
}

.ecs-dashboard__live i {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--ecs-green-bright);
  box-shadow: 0 0.25rem 0.8rem rgba(99, 206, 94, 0.45);
  animation: ecs-live-pulse 2.2s var(--ease-out) infinite;
}

@keyframes ecs-live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  52% {
    opacity: 0.58;
    transform: scale(0.76);
  }
}

.ecs-dashboard__metrics {
  display: grid;
  border-bottom: 1px solid var(--ecs-line);
  background: var(--ecs-navy-soft);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ecs-metric {
  min-width: 0;
  padding: clamp(1.4rem, 2.6vw, 2.3rem) clamp(1.25rem, 2vw, 2rem);
  border-right: 1px solid var(--ecs-line);
}

.ecs-metric:last-child {
  border-right: 0;
}

.ecs-metric > span {
  display: block;
  min-height: 2.5em;
  color: var(--ecs-text-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  line-height: 1.3;
  text-transform: uppercase;
}

.ecs-metric p {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  margin: 0.45rem 0 0;
}

.ecs-metric strong {
  font-size: clamp(2rem, 3.4vw, 3.4rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1;
}

.ecs-metric small {
  color: var(--ecs-text-soft);
  font-size: 0.82rem;
  font-weight: 500;
}

.ecs-metric em {
  display: block;
  margin-top: 0.75rem;
  color: #9fc5d8;
  font-size: 0.72rem;
  font-style: normal;
}

.ecs-dashboard__workspace {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.8fr) minmax(20rem, 0.95fr);
}

.ecs-trend,
.ecs-systems {
  min-width: 0;
  padding: clamp(1.5rem, 2.7vw, 2.6rem);
}

.ecs-trend {
  border-right: 1px solid var(--ecs-line);
}

.ecs-trend__header,
.ecs-systems__header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.ecs-trend h3,
.ecs-systems h3 {
  margin: 0;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.ecs-trend__header p,
.ecs-systems__header p {
  margin: 0.5rem 0 0;
  color: var(--ecs-text-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.ecs-range {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--ecs-line);
}

.ecs-range button {
  min-height: 2.4rem;
  padding: 0.6rem 0.8rem;
  color: var(--ecs-text-soft);
  border: 0;
  border-right: 1px solid var(--ecs-line);
  background: transparent;
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.ecs-range button:last-child {
  border-right: 0;
}

.ecs-range button:hover,
.ecs-range button[aria-pressed="true"] {
  color: var(--ecs-navy);
  background: var(--ecs-white);
}

.ecs-trend__legend {
  display: flex;
  gap: 1.25rem;
  margin-top: clamp(1.75rem, 3vw, 2.75rem);
  color: var(--ecs-text-soft);
  font-size: 0.7rem;
}

.ecs-trend__legend span {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.ecs-trend__legend [hidden] {
  display: none;
}

.ecs-trend__legend b {
  font-weight: inherit;
}

.ecs-trend__key {
  display: block;
  width: 1.8rem;
  height: 0;
  border-top: 2px solid var(--ecs-cyan);
}

.ecs-trend__key--profile {
  border-top-color: rgba(255, 255, 255, 0.58);
  border-top-style: dashed;
}

.ecs-trend__key--optimized {
  border-top-color: var(--ecs-green-bright);
}

.ecs-chart {
  min-width: 0;
  margin-top: 1.1rem;
}

.ecs-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 15rem;
  overflow: visible;
}

.ecs-chart__grid line {
  stroke: rgba(206, 235, 247, 0.13);
  stroke-width: 1;
}

.ecs-chart__grid text {
  fill: #9fc5d8;
  font-family: var(--font);
  font-size: 10px;
}

.ecs-chart__area {
  fill: url(#ecs-chart-area);
  opacity: 0.86;
  transition: opacity 260ms var(--ease-out);
}

.ecs-chart__profile,
.ecs-chart__actual,
.ecs-chart__optimized {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.ecs-chart__profile {
  stroke: rgba(255, 255, 255, 0.58);
  stroke-dasharray: 5 7;
  stroke-width: 1.5;
}

.ecs-chart__actual {
  stroke: var(--ecs-cyan);
  stroke-width: 2.7;
  transition: opacity 260ms var(--ease-out);
}

.ecs-chart__optimized {
  opacity: 0;
  stroke: var(--ecs-green-bright);
  stroke-width: 3;
  transition: opacity 260ms var(--ease-out);
}

.ecs-chart__saving {
  fill: rgba(99, 206, 94, 0.28);
  opacity: 0;
  transition: opacity 260ms var(--ease-out);
}

.ecs-dashboard.is-optimized .ecs-chart__actual {
  opacity: 0.45;
}

.ecs-dashboard.is-optimized .ecs-chart__optimized,
.ecs-dashboard.is-optimized .ecs-chart__saving {
  opacity: 1;
}

.ecs-dashboard.is-updating .ecs-chart__actual,
.ecs-dashboard.is-updating .ecs-chart__area {
  opacity: 0.34;
}

.ecs-dashboard.is-optimized.is-updating .ecs-chart__optimized,
.ecs-dashboard.is-optimized.is-updating .ecs-chart__saving {
  opacity: 0.34;
}

.ecs-chart__marker {
  fill: var(--ecs-navy);
  stroke: var(--ecs-cyan);
  stroke-width: 2.5;
  transition:
    cx 260ms var(--ease-out),
    cy 260ms var(--ease-out);
}

.ecs-dashboard.is-optimized .ecs-chart__marker {
  stroke: var(--ecs-green-bright);
}

.ecs-chart__axis {
  display: grid;
  margin: -0.3rem 0 0 3.5rem;
  color: #9fc5d8;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  font-size: 0.62rem;
}

.ecs-chart__axis span:last-child {
  text-align: right;
}

.ecs-loads {
  margin-top: clamp(2rem, 3.5vw, 3.25rem);
  padding-top: 1.35rem;
  border-top: 1px solid var(--ecs-line);
}

.ecs-loads__header {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.ecs-loads h4 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
}

.ecs-loads__header > span {
  color: var(--ecs-text-soft);
  font-size: 0.65rem;
}

.ecs-loads__rows {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.ecs-load {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(5.75rem, 0.8fr) minmax(5rem, 2fr) auto;
  gap: 0.75rem;
  align-items: center;
  color: var(--ecs-text-soft);
  font-size: 0.65rem;
}

.ecs-load > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecs-load > i {
  display: block;
  height: 0.22rem;
  overflow: hidden;
  background: rgba(206, 235, 247, 0.12);
}

.ecs-load > i b {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ecs-cyan);
  transform: scaleX(var(--ecs-load));
  transform-origin: left center;
  transition: transform 320ms var(--ease-out);
}

.ecs-load > strong {
  min-width: 3.4rem;
  color: var(--ecs-white);
  font-size: 0.66rem;
  font-weight: 600;
  text-align: right;
}

.ecs-systems__attention {
  flex: 0 0 auto;
  padding: 0.45rem 0.6rem;
  color: #f8d67f;
  border: 1px solid rgba(242, 185, 54, 0.5);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
}

.ecs-dashboard.is-optimized .ecs-systems__attention {
  color: #aeeaa7;
  border-color: rgba(99, 206, 94, 0.45);
}

.ecs-systems__list {
  margin-top: 1.75rem;
  border-top: 1px solid var(--ecs-line);
}

.ecs-system {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 4.4rem;
  padding: 0.85rem 0;
  color: var(--ecs-white);
  border: 0;
  border-bottom: 1px solid var(--ecs-line);
  background: transparent;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease;
}

.ecs-system::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--ecs-cyan);
  content: "";
  opacity: 0;
}

.ecs-system:hover,
.ecs-system.is-selected {
  background: rgba(101, 215, 223, 0.075);
}

.ecs-system.is-selected::after {
  opacity: 1;
}

.ecs-system > svg {
  width: 1.45rem;
  height: 1.45rem;
  margin-left: 0.25rem;
  fill: none;
  stroke: var(--ecs-cyan);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.ecs-system > span {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.ecs-system strong {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecs-system small {
  overflow: hidden;
  color: var(--ecs-text-soft);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecs-system em {
  padding-right: 0.25rem;
  color: var(--ecs-white);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 650;
}

.ecs-system[data-ecs-system="hvac"] small {
  color: #f8d67f;
}

.ecs-dashboard.is-optimized .ecs-system[data-ecs-system="hvac"] small {
  color: #aeeaa7;
}

.ecs-asset-detail {
  padding-top: 1.7rem;
}

.ecs-asset-detail__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ecs-asset-detail__meta > span:first-child {
  color: var(--ecs-text-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.ecs-status {
  padding: 0.42rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.ecs-status--warning {
  color: #f8d67f;
  border: 1px solid rgba(242, 185, 54, 0.5);
  background: rgba(242, 185, 54, 0.08);
}

.ecs-status--online {
  color: #aeeaa7;
  border: 1px solid rgba(99, 206, 94, 0.42);
  background: rgba(99, 206, 94, 0.07);
}

.ecs-status--producing {
  color: #92e6ec;
  border: 1px solid rgba(101, 215, 223, 0.42);
  background: rgba(101, 215, 223, 0.07);
}

.ecs-asset-detail h4 {
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.ecs-asset-detail dl {
  display: grid;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--ecs-line);
  border-bottom: 1px solid var(--ecs-line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ecs-asset-detail dl div {
  min-width: 0;
  padding: 0.85rem 0.45rem 0.85rem 0;
}

.ecs-asset-detail dt {
  overflow: hidden;
  margin-bottom: 0.35rem;
  color: var(--ecs-text-soft);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecs-asset-detail dd {
  overflow: hidden;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecs-asset-detail > p {
  display: flex;
  min-block-size: 3.1em;
  margin: 1rem 0 0;
  color: var(--ecs-text-soft);
  font-size: 0.76rem;
  line-height: 1.55;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

[data-ecs-detail-insight-copy] {
  min-width: 0;
}

.ecs-asset-detail__saving {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0.38rem 0.48rem;
  color: #aeeaa7;
  border: 1px solid rgba(99, 206, 94, 0.42);
  background: rgba(99, 206, 94, 0.08);
  align-items: baseline;
  gap: 0.38rem;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.ecs-asset-detail__saving[hidden] {
  display: none;
}

.ecs-asset-detail__saving small {
  color: var(--ecs-text-soft);
  font-size: 0.54rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

[data-ecs-detail-saving-value] {
  color: #d9ffd4;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: 0;
}

.ecs-dashboard__action {
  display: grid;
  min-height: 6.75rem;
  padding: 1.35rem clamp(1.25rem, 2vw, 2rem);
  border-top: 1px solid rgba(242, 185, 54, 0.32);
  background: rgba(242, 185, 54, 0.08);
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: center;
  transition:
    background 260ms ease,
    border-color 260ms ease;
}

.ecs-dashboard.is-optimized .ecs-dashboard__action {
  border-color: rgba(99, 206, 94, 0.34);
  background: rgba(99, 206, 94, 0.08);
}

.ecs-dashboard__action-icon {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  color: var(--ecs-warning);
  border: 1px solid rgba(242, 185, 54, 0.44);
  place-items: center;
}

.ecs-dashboard.is-optimized .ecs-dashboard__action-icon {
  color: var(--ecs-green-bright);
  border-color: rgba(99, 206, 94, 0.42);
}

.ecs-dashboard__action-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.ecs-dashboard__action strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
}

.ecs-dashboard__action p {
  max-width: 67ch;
  margin: 0.35rem 0 0;
  color: var(--ecs-text-soft);
  font-size: 0.74rem;
  line-height: 1.45;
}

.ecs-dashboard__action-button {
  display: inline-flex;
  gap: 1.6rem;
  min-height: 3rem;
  padding: 0.8rem 1rem;
  color: var(--ecs-navy);
  border: 1px solid var(--ecs-white);
  background: var(--ecs-white);
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.ecs-dashboard__action-button:hover {
  color: var(--ecs-white);
  border-color: var(--ecs-cyan);
  background: transparent;
}

.ecs-dashboard__action-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

@media (max-width: 72rem) {
  .ecs-demo__title {
    grid-column: 1 / 8;
  }

  .ecs-demo__intro-copy {
    grid-column: 8 / -1;
  }

  .ecs-dashboard__workspace {
    grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 1fr);
  }

  .ecs-range button {
    padding-right: 0.6rem;
    padding-left: 0.6rem;
  }
}

@media (max-width: 60rem) {
  .ecs-demo__title {
    max-width: 12ch;
    grid-column: 1 / -1;
  }

  .ecs-demo__intro-copy {
    max-width: 40rem;
    margin-top: 2rem;
    grid-column: 4 / -1;
  }

  .ecs-dashboard__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ecs-metric:nth-child(2) {
    border-right: 0;
  }

  .ecs-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ecs-line);
  }

  .ecs-dashboard__workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .ecs-trend {
    border-right: 0;
    border-bottom: 1px solid var(--ecs-line);
  }

  .ecs-system {
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  }
}

@media (max-width: 42rem) {
  .ecs-demo {
    padding-right: clamp(1rem, 4.6vw, 1.5rem);
    padding-left: clamp(1rem, 4.6vw, 1.5rem);
  }

  .ecs-demo__title {
    font-size: clamp(2.7rem, 12vw, 4.4rem);
  }

  .ecs-demo__intro-copy {
    margin-top: 1.75rem;
    grid-column: 1 / -1;
  }

  .ecs-demo__disclaimer {
    font-size: 0.64rem;
  }

  .ecs-dashboard__toolbar {
    display: grid;
    gap: 1rem;
  }

  .ecs-dashboard__connection {
    justify-content: space-between;
    font-size: 0.62rem;
  }

  .ecs-metric {
    padding: 1.2rem 1rem;
  }

  .ecs-metric > span {
    min-height: 3.5em;
    font-size: 0.62rem;
  }

  .ecs-metric strong {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .ecs-metric em {
    display: none;
  }

  .ecs-trend,
  .ecs-systems {
    padding: 1.25rem 1rem;
  }

  .ecs-trend__header {
    display: grid;
  }

  .ecs-range {
    width: 100%;
  }

  .ecs-range button {
    flex: 1 1 0;
    min-height: 2.75rem;
  }

  .ecs-trend__legend {
    margin-top: 1.5rem;
  }

  .ecs-chart svg {
    min-height: 12.5rem;
  }

  .ecs-chart__grid text {
    font-size: 24px;
    font-weight: 600;
  }

  .ecs-chart__axis {
    margin-left: 2.7rem;
  }

  .ecs-load {
    grid-template-columns: minmax(5.5rem, 0.9fr) minmax(3.5rem, 1.6fr) auto;
    gap: 0.55rem;
  }

  .ecs-system {
    min-height: 4.1rem;
  }

  .ecs-asset-detail dl {
    gap: 0.25rem;
  }

  .ecs-dashboard__action {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ecs-dashboard__action-button {
    width: 100%;
    margin-top: 0.25rem;
    grid-column: 1 / -1;
  }
}

@media (max-width: 28rem) {
  .ecs-dashboard__connection > span:last-child {
    display: none;
  }

  .ecs-metric p {
    gap: 0.25rem;
  }

  .ecs-metric small {
    font-size: 0.68rem;
  }

  .ecs-trend__legend {
    display: grid;
    gap: 0.5rem;
  }

  .ecs-systems__header {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecs-dashboard__live i {
    animation: none;
  }

  .ecs-chart__actual,
  .ecs-chart__optimized,
  .ecs-chart__area,
  .ecs-chart__saving,
  .ecs-chart__marker,
  .ecs-dashboard__action {
    transition: none;
  }

}

/* Hero ECS: stessa grammatica immersiva della pagina Il Gruppo. */

.fm-ecs-page .group-hero--ecs {
  --group-hero-height: max(100svh, 48rem);
}

.fm-ecs-page .group-hero--ecs .group-hero__media img {
  object-position: center 54%;
}

.fm-ecs-page .group-hero--ecs .group-hero__scrim {
  background:
    linear-gradient(90deg, rgba(6, 25, 45, 0.9) 0%, rgba(6, 25, 45, 0.5) 48%, rgba(6, 25, 45, 0.08) 84%),
    linear-gradient(0deg, rgba(6, 25, 45, 0.94) 0%, rgba(6, 25, 45, 0.36) 42%, rgba(6, 25, 45, 0.06) 74%),
    linear-gradient(180deg, rgba(6, 25, 45, 0.48), transparent 30%);
}

.fm-ecs-page .group-hero--ecs .group-hero__heading {
  grid-column: 1 / -1;
}

.fm-ecs-page .group-hero--ecs .group-hero__title {
  max-width: 10ch;
  font-size: clamp(5.4rem, 8.7vw, 8.8rem);
  letter-spacing: -0.04em;
  line-height: 0.86;
}

.fm-ecs-page .group-hero--ecs
  .group-hero__title-line:not(.group-hero__title-line--small) {
  margin-bottom: -0.18em;
  padding-bottom: 0.18em;
}

.fm-ecs-page .group-hero--ecs .group-hero__title-line--small {
  margin-bottom: 0.26em;
  margin-left: 0.04em;
  font-size: 0.31em;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.fm-ecs-page .group-hero--ecs .group-hero__lead {
  background: rgba(6, 25, 45, 0.8);
}

/* Capacità ECS: una topologia di controllo, non una lista di card. */

.ecs-capabilities {
  --ecs-capability-blue: #0a2c6a;
  --ecs-capability-blue-deep: #06192d;
  --ecs-capability-cyan: #3ebdc9;
  --ecs-capability-green: #4fbd51;
  --ecs-capability-line: rgba(17, 57, 128, 0.2);

  position: relative;
  overflow: hidden;
  padding: clamp(6rem, 10vw, 10rem) var(--gutter);
  color: var(--ink);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.ecs-capabilities__inner {
  width: min(100%, var(--content-max));
  margin: 0 auto;
}

.ecs-capabilities__header {
  display: grid;
  margin-bottom: clamp(4rem, 7vw, 7rem);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 2rem);
  align-items: end;
}

.ecs-capabilities__header h2 {
  max-width: 11ch;
  margin: 0;
  grid-column: 1 / 8;
  font-size: clamp(3.2rem, 5.7vw, 5.75rem);
  font-weight: 250;
  letter-spacing: -0.04em;
  line-height: 0.96;
  text-wrap: balance;
}

.ecs-capabilities__header p {
  max-width: 42rem;
  margin: 0;
  grid-column: 8 / -1;
  color: rgba(17, 27, 48, 0.75);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.7;
}

.ecs-capabilities__layout {
  display: grid;
  min-height: 39rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.ecs-topology {
  position: relative;
  min-width: 0;
  min-height: 39rem;
  overflow: hidden;
  grid-column: 1 / 8;
  border-right: 1px solid rgba(203, 232, 246, 0.2);
  background:
    radial-gradient(ellipse 52% 46% at 50% 53%, rgba(101, 215, 223, 0.14), transparent 72%),
    radial-gradient(circle at 50% 4%, rgba(79, 189, 81, 0.12), transparent 38%),
    linear-gradient(135deg, #06192d, #0a223c);
  isolation: isolate;
}

.ecs-topology__connections {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ecs-topology__orbit,
.ecs-topology__core-ring,
.ecs-topology__axis,
.ecs-topology__connection {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.ecs-topology__orbit,
.ecs-topology__core-ring {
  stroke: rgba(188, 212, 226, 0.3);
  stroke-width: 1;
}

.ecs-topology__orbit {
  stroke-dasharray: 3 9;
}

.ecs-topology__axis {
  stroke: rgba(188, 212, 226, 0.14);
  stroke-width: 1;
}

.ecs-topology__connection {
  stroke: rgba(188, 212, 226, 0.44);
  stroke-linecap: round;
  stroke-width: 1.2;
  transition:
    stroke 220ms ease,
    stroke-width 220ms ease;
}

.ecs-topology__connection.is-active {
  stroke: var(--ecs-capability-cyan);
  stroke-width: 2.6;
}

.ecs-topology__synapse {
  fill: none;
  opacity: 0.3;
  stroke: var(--ecs-capability-cyan);
  stroke-dasharray: 1.4 26;
  stroke-linecap: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.ecs-topology.is-energized .ecs-topology__synapse {
  animation: ecs-synapse-current 7.2s linear infinite;
}

.ecs-topology.is-energized .ecs-topology__synapse--2 {
  animation-delay: -1.4s;
}

.ecs-topology.is-energized .ecs-topology__synapse--3 {
  animation-delay: -2.8s;
}

.ecs-topology.is-energized .ecs-topology__synapse--4 {
  animation-delay: -4.2s;
}

.ecs-topology.is-energized .ecs-topology__synapse--5 {
  animation-delay: -5.6s;
}

.ecs-topology.is-energized .ecs-topology__connection.is-active + .ecs-topology__synapse {
  opacity: 0.88;
  stroke: var(--ecs-capability-green);
  stroke-width: 3;
}

.ecs-topology__hub {
  position: absolute;
  z-index: 2;
  top: 53.5%;
  left: 50%;
  display: grid;
  width: clamp(10.5rem, 13vw, 12rem);
  overflow: hidden;
  padding: 1.35rem;
  color: var(--white);
  border: 1px solid rgba(101, 215, 223, 0.55);
  background: var(--ecs-capability-blue-deep);
  place-items: center;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.ecs-topology__hub::before,
.ecs-topology__hub::after {
  position: absolute;
  width: 2.6rem;
  height: 2.6rem;
  content: "";
  pointer-events: none;
}

.ecs-topology__hub::before {
  top: 0.7rem;
  left: 0.7rem;
  border-top: 1px solid rgba(101, 215, 223, 0.62);
  border-left: 1px solid rgba(101, 215, 223, 0.62);
}

.ecs-topology__hub::after {
  right: 0.7rem;
  bottom: 0.7rem;
  border-right: 1px solid rgba(79, 189, 81, 0.68);
  border-bottom: 1px solid rgba(79, 189, 81, 0.68);
}

.ecs-topology__hub img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

.ecs-topology__hub small {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  color: rgba(247, 251, 255, 0.7);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ecs-topology__hub-scan {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: -45%;
  width: 34%;
  background: rgba(101, 215, 223, 0.22);
  opacity: 0;
  transform: skewX(-12deg);
}

.ecs-topology__nodes {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.ecs-topology__nodes::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 50% 53.5%, rgba(101, 215, 223, 0.62) 0 0.22rem, transparent 0.3rem),
    radial-gradient(circle at 50% 53.5%, transparent 0 5.4rem, rgba(101, 215, 223, 0.34) 5.45rem 5.52rem, transparent 5.58rem),
    radial-gradient(circle at 15% 17%, rgba(79, 189, 81, 0.55) 0 0.18rem, transparent 0.24rem),
    radial-gradient(circle at 50% 10%, rgba(101, 215, 223, 0.52) 0 0.18rem, transparent 0.24rem),
    radial-gradient(circle at 85% 17%, rgba(79, 189, 81, 0.55) 0 0.18rem, transparent 0.24rem),
    radial-gradient(circle at 16% 86%, rgba(101, 215, 223, 0.48) 0 0.18rem, transparent 0.24rem),
    radial-gradient(circle at 84% 86%, rgba(79, 189, 81, 0.5) 0 0.18rem, transparent 0.24rem);
  content: "";
  opacity: 0.72;
  pointer-events: none;
  transform-origin: 50% 53.5%;
}

.ecs-topology.is-energized .ecs-topology__nodes::before {
  animation: ecs-topology-field 6.8s ease-in-out infinite;
}

.ecs-topology__node {
  position: absolute;
  display: grid;
  width: clamp(8.5rem, 11vw, 10rem);
  min-height: 8.8rem;
  padding: 0.5rem;
  color: var(--ecs-white);
  border: 0;
  border-radius: 0;
  background: transparent;
  place-items: center;
  align-content: start;
  cursor: pointer;
}

.ecs-topology__node--1 {
  top: 3%;
  left: 2.5%;
}

.ecs-topology__node--2 {
  top: 1.6%;
  left: 50%;
  transform: translateX(-50%);
}

.ecs-topology__node--3 {
  top: 3%;
  right: 2.5%;
}

.ecs-topology__node--4 {
  bottom: 1.5%;
  left: 4%;
}

.ecs-topology__node--5 {
  right: 4%;
  bottom: 1.5%;
}

.ecs-topology__node-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(5.25rem, 6.8vw, 6.25rem);
  margin-bottom: 0.55rem;
  place-items: center;
  aspect-ratio: 0.88;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ecs-topology__node-icon::after {
  position: absolute;
  right: 3%;
  bottom: 4%;
  width: 0.52rem;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: rgba(17, 57, 128, 0.34);
  content: "";
  aspect-ratio: 1;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.ecs-topology__node-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.45rem 0.72rem rgba(0, 0, 0, 0.34));
  transition: filter 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: no-preference) {
  :where(.ecs-topology.is-energized) .ecs-topology__node-icon img {
    animation: ecs-node-float 5.8s ease-in-out infinite;
  }

  :where(.ecs-topology.is-energized) .ecs-topology__node--2 .ecs-topology__node-icon img {
    animation-delay: -1.2s;
  }

  :where(.ecs-topology.is-energized) .ecs-topology__node--3 .ecs-topology__node-icon img {
    animation-delay: -2.4s;
  }

  :where(.ecs-topology.is-energized) .ecs-topology__node--4 .ecs-topology__node-icon img {
    animation-delay: -3.6s;
  }

  :where(.ecs-topology.is-energized) .ecs-topology__node--5 .ecs-topology__node-icon img {
    animation-delay: -4.8s;
  }
}

.ecs-topology__node-label {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 12rem;
  min-height: 2.4em;
  color: rgba(247, 251, 255, 0.82);
  font-size: clamp(0.67rem, 0.82vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  transition: color 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .ecs-topology__node:hover .ecs-topology__node-label {
    color: var(--ecs-capability-cyan);
  }
}

.ecs-topology__node:hover .ecs-topology__node-icon,
.ecs-topology__node.is-active .ecs-topology__node-icon,
.ecs-topology__node:focus-visible .ecs-topology__node-icon {
  transform: translateY(-0.22rem) scale(1.04);
}

@media (hover: hover) and (pointer: fine) {
  .ecs-topology__node:hover .ecs-topology__node-icon {
    transform: translateY(-0.5rem) scale(1.16);
  }

  .ecs-topology__node:hover .ecs-topology__node-icon img {
    animation: none;
    filter: drop-shadow(0 0.8rem 1rem rgba(0, 0, 0, 0.46));
  }
}

.ecs-topology__node:hover .ecs-topology__node-icon::after,
.ecs-topology__node.is-active .ecs-topology__node-icon::after,
.ecs-topology__node:focus-visible .ecs-topology__node-icon::after {
  background: var(--ecs-capability-green);
  transform: scale(1.22);
}

.ecs-topology__node.is-active .ecs-topology__node-label {
  color: var(--ecs-capability-cyan);
}

.ecs-topology__node:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.ecs-capabilities__details {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 39rem;
  overflow: hidden;
  color: var(--white);
  background: var(--ecs-capability-blue);
  grid-column: 8 / -1;
}

.ecs-capability-panel {
  display: flex;
  min-width: 0;
  padding: clamp(2.5rem, 4vw, 4.5rem);
  flex-direction: column;
  justify-content: center;
}

.ecs-capabilities.is-enhanced .ecs-capability-panel {
  grid-area: 1 / 1;
}

.ecs-capabilities.is-enhanced .ecs-capability-panel[hidden] {
  display: none;
}

.ecs-capability-panel__status {
  display: inline-flex;
  width: fit-content;
  gap: 0.65rem;
  align-items: center;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.ecs-capability-panel__status i {
  width: 0.52rem;
  border-radius: 50%;
  background: var(--ecs-capability-green);
  box-shadow: 0 0.25rem 0.8rem rgba(79, 189, 81, 0.34);
  aspect-ratio: 1;
}

.ecs-capability-panel h3 {
  max-width: 11ch;
  margin: clamp(2rem, 4vw, 4rem) 0 0;
  font-size: clamp(2.55rem, 4.2vw, 4.25rem);
  font-weight: 250;
  letter-spacing: -0.04em;
  line-height: 0.96;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.ecs-capability-panel p {
  max-width: 39rem;
  margin: clamp(2rem, 3vw, 3rem) 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  line-height: 1.68;
}

.ecs-capability-panel__signal {
  display: flex;
  height: 2.4rem;
  gap: 0.38rem;
  align-items: end;
  margin-top: clamp(3rem, 6vw, 6rem);
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.ecs-capability-panel__signal i {
  width: 0.24rem;
  height: 42%;
  background: rgba(101, 215, 223, 0.74);
  transform-origin: bottom;
}

.ecs-capability-panel__signal i:nth-child(2) {
  height: 72%;
}

.ecs-capability-panel__signal i:nth-child(3) {
  height: 54%;
}

.ecs-capability-panel__signal i:nth-child(4) {
  height: 92%;
  background: rgba(79, 189, 81, 0.84);
}

.ecs-capability-panel__signal i:nth-child(5) {
  height: 62%;
}

.ecs-capability-panel__signal i:nth-child(6) {
  height: 78%;
}

@keyframes ecs-connection-travel {
  from {
    stroke-dasharray: 0 880;
    stroke-dashoffset: 0;
  }

  to {
    stroke-dasharray: 880 0;
    stroke-dashoffset: -32;
  }
}

@keyframes ecs-synapse-current {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -220;
  }
}

@keyframes ecs-topology-field {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.985);
  }

  50% {
    opacity: 0.94;
    transform: scale(1.015);
  }
}

@keyframes ecs-node-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-0.38rem);
  }
}

@keyframes ecs-hub-scan {
  0% {
    left: -45%;
    opacity: 0;
  }

  22% {
    opacity: 1;
  }

  100% {
    left: 116%;
    opacity: 0;
  }
}

@keyframes ecs-capability-panel-enter {
  from {
    opacity: 0;
    clip-path: inset(0 0 12% 0);
    transform: translateY(1.2rem);
  }

  to {
    opacity: 1;
    clip-path: inset(0);
    transform: none;
  }
}

.ecs-capabilities.is-switching .ecs-topology__connection.is-active {
  animation: ecs-connection-travel 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ecs-capabilities.is-switching .ecs-topology__hub-scan {
  animation: ecs-hub-scan 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ecs-capabilities.is-switching .ecs-capability-panel.is-active {
  animation: ecs-capability-panel-enter 430ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fm-ecs-page .inner-contact-cta .contact-cta__media img {
  object-position: center 46%;
}

@media (max-width: 70rem) {
  .ecs-capabilities__header h2 {
    grid-column: 1 / 7;
  }

  .ecs-capabilities__header p {
    grid-column: 7 / -1;
  }

  .ecs-capabilities__layout {
    min-height: 0;
  }

  .ecs-topology {
    min-height: 36rem;
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ecs-capabilities__details {
    min-height: 27rem;
    grid-column: 1 / -1;
  }

  .ecs-capability-panel h3 {
    max-width: 14ch;
  }

  .ecs-capability-panel__signal {
    margin-top: 3rem;
  }
}

@media (max-width: 48rem) {
  .fm-ecs-page .group-hero--ecs {
    --group-hero-height: max(100svh, 46rem);
  }

  .fm-ecs-page .group-hero--ecs .group-hero__media img {
    object-position: 54% center;
  }

  .fm-ecs-page .group-hero--ecs .group-hero__title {
    max-width: none;
    font-size: clamp(3.65rem, 16vw, 5.1rem);
    line-height: 0.9;
  }

  .fm-ecs-page .group-hero--ecs .group-hero__title-line--small {
    font-size: 0.36em;
  }

  .ecs-capabilities {
    padding-right: 0;
    padding-left: 0;
  }

  .ecs-capabilities__header,
  .ecs-capabilities__layout {
    margin-right: var(--gutter);
    margin-left: var(--gutter);
  }

  .ecs-capabilities__header {
    display: block;
    margin-bottom: 3.5rem;
  }

  .ecs-capabilities__header h2 {
    font-size: clamp(2.75rem, 12vw, 4.2rem);
  }

  .ecs-capabilities__header p {
    margin-top: 2rem;
  }

  .ecs-capabilities__layout {
    display: block;
    border-bottom: 0;
  }

  .ecs-topology {
    min-height: 0;
    overflow: visible;
    border-bottom: 0;
    background: var(--ecs-capability-blue-deep);
  }

  .ecs-topology__connections,
  .ecs-topology__hub {
    display: none;
  }

  .ecs-topology__nodes::before {
    display: none;
  }

  .ecs-topology__nodes {
    position: static;
    display: flex;
    width: calc(100% + var(--gutter));
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.25rem var(--gutter) 1.5rem 0.25rem;
    scroll-padding-inline: 0.25rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .ecs-topology__node,
  .ecs-topology__node--1,
  .ecs-topology__node--2,
  .ecs-topology__node--3,
  .ecs-topology__node--4,
  .ecs-topology__node--5 {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 8.9rem;
    min-height: 9.6rem;
    flex: 0 0 8.9rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid rgba(188, 212, 226, 0.28);
    background: rgba(255, 255, 255, 0.06);
    scroll-snap-align: start;
    transform: none;
  }

  .ecs-topology__node.is-active {
    border-color: var(--ecs-capability-cyan);
    background: rgba(101, 215, 223, 0.12);
  }

  .ecs-topology__node-icon {
    width: 5.4rem;
  }

  .ecs-topology__node.is-active .ecs-topology__node-icon {
    transform: translateY(-0.14rem) scale(1.03);
  }

  .ecs-capabilities__details {
    min-height: 29rem;
  }

  .ecs-capability-panel {
    min-height: 29rem;
    padding: 2.25rem 1.5rem;
  }

  .ecs-capability-panel h3 {
    font-size: clamp(2.35rem, 11vw, 3.5rem);
  }

  .ecs-capability-panel__signal {
    margin-top: 2.5rem;
  }
}

@media (max-width: 28rem) {
  .fm-ecs-page .group-hero--ecs .group-hero__title {
    font-size: clamp(3.25rem, 15.5vw, 4.35rem);
  }

  .fm-ecs-page .group-hero--ecs .group-hero__stages strong {
    font-size: 0.58rem;
  }

  .ecs-capability-panel h3 {
    overflow-wrap: normal;
    hyphens: auto;
  }
}

@media (max-width: 22.5rem) {
  .ecs-capabilities__details,
  .ecs-capability-panel {
    min-height: 32rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecs-topology__connection,
  .ecs-topology__synapse,
  .ecs-topology__node-icon,
  .ecs-topology__node-icon img,
  .ecs-topology__node-icon::after,
  .ecs-topology__nodes::before {
    transition: none;
    animation: none;
  }

  .ecs-capabilities.is-switching .ecs-topology__connection.is-active,
  .ecs-capabilities.is-switching .ecs-topology__hub-scan,
  .ecs-capabilities.is-switching .ecs-capability-panel.is-active {
    animation: none;
  }
}
