/* Preview-only refinement: site card alignment, compact VPP events, central pulse lane. */

/* The v5 current owns the directory pulse presentation. */
.site-energy-network-canvas-v4 {
  opacity: 0 !important;
  visibility: hidden !important;
}

.site-energy-network-canvas-v5 {
  position: absolute;
  z-index: 9;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Keep the top energy tally readable in kWh while still advancing at 1 Wh resolution. */
.energy-dashboard-v3-energy-main > strong[data-month-generation-kwh-final] {
  font-size: 29px;
  letter-spacing: -.025em;
  white-space: nowrap;
}

/* Use the full card width below the mark/name row. */
.sidebar .site-row.site-energy-card {
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 4px;
  padding: 9px 8px 10px;
}

.sidebar .site-energy-card .site-logo {
  grid-column: 1;
  grid-row: 1;
  width: 27px;
  height: 27px;
  margin: 1px 0 0 1px;
  align-self: start;
}

.sidebar .site-energy-card .site-copy {
  display: contents !important;
}

.sidebar .site-energy-card .site-name {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  padding: 0;
  font-size: 12.6px;
  line-height: 1.18;
}

.sidebar .site-energy-card .site-energy-details {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 3px 0 0;
}

/* Move the VPP designation under the site name, rather than into the logo rail. */
.sidebar .site-energy-card .site-vpp-participant {
  position: static !important;
  order: -1;
  justify-self: start;
  width: auto !important;
  min-height: 20px;
  margin: 0 0 1px 35px !important;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 6.8px;
  line-height: 1;
  white-space: nowrap;
}

/* Give the two core site metrics clear hierarchy and enough width to stay on one line. */
.sidebar .site-energy-card .site-energy-metric {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 0 1px;
  color: #59677f;
  font-size: 9.35px;
  font-weight: 800;
  line-height: 1.1;
}

.sidebar .site-energy-card .site-energy-metric > span {
  white-space: nowrap;
}

.sidebar .site-energy-card .site-energy-metric strong {
  color: #17366f;
  font-family: "Oswald", sans-serif;
  font-size: 16.2px;
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.012em;
  white-space: nowrap;
}

/* The divider above current flow is also the visual lane where site energy gathers and exits. */
.sidebar .site-energy-card .site-energy-powering {
  position: relative;
  margin-top: 5px;
  padding-top: 12px;
  border-top-color: rgba(0,32,92,.13);
}

.sidebar .site-energy-card .site-energy-powering-label {
  font-size: 9px;
}

.sidebar .site-energy-card .site-energy-flow-cell strong {
  font-size: 14.1px;
}

.sidebar .site-energy-card .site-energy-flow-cell > span {
  font-size: 7.25px;
}

/* Compact VPP-event buttons; the discharged energy is visually distinct from the date. */
.profile .vpp-event.vpp-event-history {
  gap: 7px;
  padding: 10px 14px 11px;
}

.profile .vpp-event.vpp-event-history > strong {
  font-size: 11.5px;
}

.profile .vpp-event.vpp-event-history .vpp-event-history-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.profile .vpp-event.vpp-event-history .vpp-event-history-list > span {
  min-height: 31px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "date energy"
    "date destination";
  align-items: center;
  column-gap: 6px;
  row-gap: 0;
  padding: 4px 7px;
  border-radius: 10px;
  font-size: 8.6px;
  line-height: 1.05;
  text-align: left;
}

.profile .vpp-event.vpp-event-history .vpp-event-date {
  grid-area: date;
  color: #3548aa;
  font-size: 8.8px;
  font-weight: 850;
  white-space: nowrap;
}

.profile .vpp-event.vpp-event-history .vpp-event-energy {
  grid-area: energy;
  color: #a86f00;
  font-family: "Oswald", sans-serif;
  font-size: 10.4px;
  font-weight: 700;
  white-space: nowrap;
}

.profile .vpp-event.vpp-event-history .vpp-event-destination {
  grid-area: destination;
  color: #68748a;
  font-size: 7.4px;
  font-weight: 750;
  white-space: nowrap;
}

@media (max-width: 430px) {
  .sidebar .site-row.site-energy-card {
    grid-template-columns: 32px minmax(0, 1fr);
    padding-inline: 7px;
  }

  .sidebar .site-energy-card .site-logo {
    width: 25px;
    height: 25px;
  }

  .sidebar .site-energy-card .site-vpp-participant {
    margin-left: 33px !important;
  }

  .sidebar .site-energy-card .site-energy-metric {
    font-size: 8.9px;
  }

  .sidebar .site-energy-card .site-energy-metric strong {
    font-size: 15.2px;
  }
}