/* Vivid redesign: Garage and the Home energy hub (#screen-fleet, #screen-homeenergy). Loaded after styles-vivid.css; scope every rule to this area. */

/* =====================================================================================================================
   Garage (#screen-fleet): one blue hero per car, the amber house, a dashed "Add a car or device", and an empty state
   per situation (no Tesla, loading, signed out, home-only, shared viewer), each with one next step.
   ===================================================================================================================== */
#screen-fleet .fleet-card {
  padding: 16px 16px 14px;
  border-radius: var(--v-r-hero);
  -webkit-tap-highlight-color: transparent;
}

#screen-fleet .fleet-card .titlerow .v-lbl {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 500;
}

#screen-fleet .fleet-ruler-foot {
  margin-top: 8px;
  font-size: 13px;
}

#screen-fleet .fleet-stat .v-val {
  margin-top: 2px;
}

#screen-fleet .fleet-home-slot:empty,
#screen-fleet .fleet-empty-slot:empty,
#screen-fleet .fleet-vehicles:empty {
  display: none;
}

/* Add a car or device: a quiet dashed row under what's there. */
#screen-fleet #fleetAdd {
  min-height: 60px;
  padding: 10px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--v-r-card);
  background: transparent;
  box-shadow: none;
}

#screen-fleet #fleetAdd.hidden {
  display: none;
}

#screen-fleet #fleetAdd .v-ico {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

#screen-fleet #fleetAdd .v-ttl {
  font-size: 16px;
  font-weight: 600;
}

/* Empty states: a hero with the dimmed illustration (no Tesla, no Powerwall yet), or a plain card with an icon. */
#screen-fleet .fleet-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 18px;
}

#screen-fleet .fleet-empty.v-card {
  border-radius: var(--v-r-card);
}

#screen-fleet .fleet-empty.v-card.coral {
  border-color: rgba(255, 106, 92, 0.35);
  background: linear-gradient(140deg, rgba(255, 106, 92, 0.16), rgba(255, 106, 92, 0) 60%), var(--v-card);
}

#screen-fleet .fleet-empty.v-card.sun-line {
  border-color: rgba(255, 181, 71, 0.3);
}

#screen-fleet .fleet-empty .v-ico {
  margin-bottom: 6px;
}

#screen-fleet .fleet-empty .v-ttl {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

#screen-fleet .fleet-empty .v-lbl {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

#screen-fleet .fleet-empty .v-btn {
  align-self: stretch;
  margin-top: 12px;
}

/* On a blue or amber hero the one action is white, as on Today's hero (a blue button on blue would barely read). */
#screen-fleet .fleet-empty.hero .v-btn.primary {
  border: 0;
  color: #0B2A6B;
  background: #fff;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  font-weight: 700;
}

#screen-fleet .fleet-empty.hero.sun .v-btn.primary {
  color: #6A2C0B;
}

#screen-fleet .fleet-empty-art {
  display: block;
  align-self: stretch;
  margin: -4px -4px 4px;
  opacity: 0.55;
  filter: saturate(0.7);
}

#screen-fleet .fleet-empty.sun .fleet-empty-art {
  margin: -6px 14% 4px 12%;
}

#screen-fleet .fleet-empty-art svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: #000;
  stroke: none;
}

#screen-fleet .fleet-empty-note {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

/* Loading: the car art breathes and two bars shimmer where the ruler will be. */
#screen-fleet .fleet-empty.loading .fleet-empty-art {
  animation: fleet-breathe 1.8s ease-in-out infinite;
}

#screen-fleet .fleet-skeleton {
  display: grid;
  gap: 8px;
  align-self: stretch;
  margin-top: 10px;
}

#screen-fleet .fleet-skeleton i,
#screen-homeenergy .energy-skeleton i {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  background-size: 200% 100%;
  animation: fleet-shimmer 1.4s linear infinite;
}

#screen-fleet .fleet-skeleton i:last-child {
  width: 60%;
}

@keyframes fleet-shimmer {
  to { background-position: -200% 0; }
}

@keyframes fleet-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
  #screen-fleet .fleet-empty.loading .fleet-empty-art,
  #screen-fleet .fleet-skeleton i,
  #screen-homeenergy .energy-skeleton i {
    animation: none;
  }
}

body.app-paused #screen-fleet *,
body.app-paused #screen-homeenergy * {
  animation-play-state: paused;
}

/* =====================================================================================================================
   Home energy hub (#screen-homeenergy)
   ===================================================================================================================== */
#screen-homeenergy #homeEnergyTiles .v-tile {
  gap: 7px;
  min-height: 112px;
  padding: 14px;
}

#screen-homeenergy #homeEnergyTiles .v-tile .v-ttl {
  margin-top: 4px;
  font-size: 16px !important;
}

#screen-homeenergy #homeEnergyTiles .v-tile .v-lbl {
  font-size: 13px;
  line-height: 1.35;
}

#screen-homeenergy #homeEnergyWeatherTile .v-ttl {
  font-size: 17px;
}

/* The hub without live home energy: why, and one button. */
#screen-homeenergy .energy-hub-offline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px;
}

#screen-homeenergy .energy-hub-offline .v-ico {
  margin-bottom: 6px;
}

#screen-homeenergy .energy-hub-offline .v-ttl {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

#screen-homeenergy .energy-hub-offline .v-lbl {
  font-size: 14px;
  line-height: 1.45;
}

#screen-homeenergy .energy-hub-offline .v-btn {
  align-self: stretch;
  margin-top: 12px;
}

/* The VueRate Home notice: a calm amber card at the end of the hub. Icon + plan chip, a title, one sentence with the
   price, then the vivid primary and a quiet Not now. */
#screen-homeenergy .home-plan-notice:not(.hidden) {
  gap: 14px;
  margin: 0;
  padding: 18px;
  border-color: rgba(255, 181, 71, 0.3);
  background: radial-gradient(70% 60% at 100% 0%, rgba(255, 154, 47, 0.2), rgba(255, 154, 47, 0) 70%), var(--v-card);
}

#screen-homeenergy .home-plan-notice-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

#screen-homeenergy .home-plan-notice .home-plan-notice-top .eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--v-ink-amber);
  background: var(--v-sun);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

#screen-homeenergy .home-plan-notice h3 {
  font-size: 18px;
  letter-spacing: -0.01em;
}

#screen-homeenergy .home-plan-notice-actions .primary-action {
  border: 0;
  color: #fff;
  background: linear-gradient(160deg, #3D8BFF, #1A4FC4);
  box-shadow: 0 8px 24px -10px rgba(61, 139, 255, 0.9);
  font-weight: 650;
}

#screen-homeenergy .home-plan-notice-actions .secondary-action {
  border: 1px solid var(--v-line-strong);
  color: var(--v-tx);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}

/* ---------- Sub-pages: loading, can't load, and part of VueRate Home ---------- */
#screen-homeenergy .energy-page-empty:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px;
}

#screen-homeenergy .energy-page-empty-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
  gap: 10px;
  margin-bottom: 6px;
}

#screen-homeenergy .energy-page-empty .v-ttl {
  font-size: 19px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

#screen-homeenergy .energy-page-empty .v-lbl {
  font-size: 14px;
  line-height: 1.45;
}

#screen-homeenergy .energy-page-empty .v-btn {
  align-self: stretch;
  margin-top: 12px;
}

#screen-homeenergy .energy-page-empty-note {
  align-self: stretch;
  margin: 4px 0 0;
  color: var(--v-tx3);
  font-size: 12.5px;
  text-align: center;
}

#screen-homeenergy .energy-skeleton {
  display: grid;
  gap: 8px;
  align-self: stretch;
  margin-top: 12px;
}

#screen-homeenergy .energy-skeleton i:nth-child(1) {
  height: 64px;
  border-radius: 12px;
}

#screen-homeenergy .energy-skeleton i:nth-child(3) {
  width: 55%;
}

/* ---------- Sub-pages: one vivid primary, glass secondaries ---------- */
#screen-homeenergy .energy-page .primary-action:not(.hidden) {
  border: 0;
  color: #fff;
  background: linear-gradient(160deg, #3D8BFF, #1A4FC4);
  box-shadow: 0 8px 24px -10px rgba(61, 139, 255, 0.9);
  font-weight: 650;
}

#screen-homeenergy .energy-page .secondary-action:not(.hidden) {
  border: 1px solid var(--v-line-strong);
  color: var(--v-tx);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  font-weight: 600;
}

/* Each sub-page has its title in the header, so the cards don't repeat it as an eyebrow ("WEEK AHEAD" under
   "Week ahead"); the source line ("Chicago, IL · NWS forecast", "Updated 12:38 PM") stays, small, on the left. */
#screen-homeenergy .energy-page[data-energy-page="day"] .hew-head > .eyebrow,
#screen-homeenergy .energy-page[data-energy-page="week"] .hew-head > .eyebrow,
#screen-homeenergy .energy-page[data-energy-page="worth"] .hew-head > .eyebrow {
  display: none;
}

#screen-homeenergy .energy-page .hew-head {
  justify-content: flex-start;
}

#screen-homeenergy .energy-page .hew-head:not(:has(> .hew-source:not(:empty))) {
  display: none;
}

#screen-homeenergy .energy-page .hew-source {
  margin: 0;
  color: var(--v-tx3);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

/* Headlines inside the pages read as the card's title. */
#screen-homeenergy .energy-page :is(.day-plan, .home-energy-week, .solar-worth) > h3 {
  margin: 2px 0 0;
  color: var(--v-tx);
  font-size: 19px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

#screen-homeenergy .energy-page .day-plan .dp-sentence,
#screen-homeenergy .energy-page .home-energy-week .hew-sub {
  color: var(--v-tx2);
  font-size: 14px;
  line-height: 1.45;
}

/* Weather plan: "Weather plan" is the card's title, its status a pill on the right (as in mockup 05). */
#screen-homeenergy .weather-plan .wp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#screen-homeenergy .weather-plan .wp-head .eyebrow {
  margin: 0;
  color: var(--v-tx);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-transform: none;
}

#screen-homeenergy .weather-plan .wp-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--v-tx2) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

#screen-homeenergy .weather-plan .wp-status.on {
  color: var(--v-ink-mint) !important;
  background: var(--v-mint) !important;
}

#screen-homeenergy .weather-plan .wp-status.paused {
  color: var(--v-ink-amber) !important;
  background: var(--v-sun) !important;
}

#screen-homeenergy .weather-plan .wp-status.error {
  color: #fff !important;
  background: rgba(255, 106, 92, 0.32) !important;
}

#screen-homeenergy .weather-plan > h3 {
  color: var(--v-tx);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

/* ---------- Powerwall page: the mint hero, then the live card without the hub's flow diagram ---------- */
#screen-homeenergy #powerwallHero:empty {
  display: none;
}

#screen-homeenergy .pw-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#screen-homeenergy .pw-top {
  display: flex;
  align-items: center;
  gap: clamp(12px, 4vw, 18px);
}

#screen-homeenergy .pw-ring {
  position: relative;
  flex: none;
  width: clamp(96px, 29vw, 112px);
  height: clamp(96px, 29vw, 112px);
}

#screen-homeenergy .pw-ring .v-ring {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
}

#screen-homeenergy .pw-ring .v-ring circle {
  fill: none;
  stroke-linecap: round;
}

#screen-homeenergy .pw-ring-c {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

#screen-homeenergy .pw-ring-c .v-big {
  font-size: clamp(26px, 8.4vw, 32px);
}

#screen-homeenergy .pw-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#screen-homeenergy .pw-side p {
  margin: 0;
}

#screen-homeenergy .pw-side .v-val {
  font-size: clamp(18px, 5.6vw, 22px);
}

#screen-homeenergy .pw-status {
  margin: 2px 0 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

#screen-homeenergy .pw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#screen-homeenergy .pw-settings {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(0, 20, 12, 0.32);
  font-weight: 650;
}

#screen-homeenergy .pw-wait {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

#energyPagePowerwall #homeEnergyCard :is(.he-head, .he-flow-diagram, .he-more),
#energyPagePowerwall #homeEnergyCard > .he-note {
  display: none;
}

#energyPagePowerwall #homeEnergyCard .he-foot {
  justify-content: flex-start;
}

/* The solar tip: under 380px its words get the full width and the button sits under them. */
@media (max-width: 379px) {
  #screen-homeenergy #homeEnergyCard .he-tip {
    grid-template-columns: minmax(0, 1fr);
  }

  #screen-homeenergy #homeEnergyCard .he-tip button {
    justify-self: start;
  }
}

/* Today's three facts become label / value rows when a third of the card is too narrow for "Self-powered". */
@media (max-width: 359px) {
  #screen-homeenergy #homeEnergyCard .he-facts {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #screen-homeenergy #homeEnergyCard .he-facts > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
}

/* =====================================================================================================================
   Charge sheet (#screen-garage overlay): the battery as a blue hero with a heavy numeral and the glowing ruler.
   ===================================================================================================================== */
#screen-garage #garageVehicleDataCard {
  margin: 6px 0 10px;
  padding: 16px 16px 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--v-r-card) !important;
  background: var(--v-hero-car) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 40px -22px rgba(61, 139, 255, 0.7) !important;
}

#screen-garage #garageVehicleDataTitle {
  color: #fff;
  font-size: clamp(44px, 14vw, 56px);
  font-weight: 800;
  letter-spacing: -0.045em;
}

#screen-garage #garageVehicleDataCard .charge-battery-range,
#screen-garage #garageVehicleDataCard .range-labels,
#screen-garage #garageVehicleDataCard .range-labels strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

#screen-garage #garageVehicleDataCard .range-labels strong {
  color: #FFD9A6;
}

#screen-garage #garageVehicleDataCard .range-meter {
  background: rgba(255, 255, 255, 0.16);
}

#screen-garage #garageVehicleDataCard .range-meter > span {
  background: linear-gradient(90deg, #7DB8FF, #fff);
  box-shadow: 0 0 12px rgba(155, 208, 255, 0.8);
}

#screen-garage #garageVehicleDataCard .range-meter-limit {
  width: 4px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.55);
}

#screen-garage .charge-level-heading strong {
  font-weight: 600;
}

#screen-garage .garage-command-actions .primary-action:not(:disabled) {
  border: 0;
  color: #fff;
  background: linear-gradient(160deg, #3D8BFF, #1A4FC4);
  box-shadow: 0 8px 24px -10px rgba(61, 139, 255, 0.9);
  font-weight: 650;
}

#screen-garage .garage-command-actions .secondary-action {
  border: 1px solid var(--v-line-strong);
  color: var(--v-tx);
  background: rgba(255, 255, 255, 0.04);
}

/* Nothing to charge yet: the empty card in the vivid look, with the one vivid primary. */
#screen-garage .charge-empty-card:not(.hidden) {
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  background: var(--v-card);
}

#screen-garage .charge-empty-card .primary-action {
  border: 0;
  color: #fff;
  background: linear-gradient(160deg, #3D8BFF, #1A4FC4);
  font-weight: 650;
}

/* =====================================================================================================================
   Review pass: every tap target 44px tall, nothing under 11px, one clean title row, nothing said twice.
   ===================================================================================================================== */

/* Small outlined buttons on the sub-pages (Charge now, Keep 100%, Turn on, Pause for today, Change limits). */
#screen-homeenergy .energy-page :is(.secondary-action, .primary-action).compact:not(.hidden),
#screen-homeenergy .energy-page .he-tip button {
  min-height: 44px;
}

/* The switches in Energy summary and the weather plan's limits get a 44px hit area. */
#screen-homeenergy .autopilot-switch {
  display: flex;
  flex: none;
  align-items: center;
  min-height: 44px;
}

/* Today's three facts on the Powerwall page: label / value rows at every width, so "1.9 · 4.1 kWh" never breaks. */
#screen-homeenergy #homeEnergyCard .he-facts {
  grid-template-columns: 1fr;
  gap: 6px;
}

#screen-homeenergy #homeEnergyCard .he-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

#screen-homeenergy #homeEnergyCard .he-facts span,
#screen-homeenergy .energy-page .hew-facts dt {
  font-size: 12px;
}

#screen-homeenergy #homeEnergyCard .he-facts strong {
  white-space: nowrap;
}

/* Hourly wind labels stay 11px at 320 (every other one hides there, so they have the room). */
#screen-homeenergy .wind-hour .h {
  font-size: 11px;
}

/* Weather plan: the title never breaks ("Weather / plan"); on a narrow phone the status pill drops under it. */
#screen-homeenergy .weather-plan .wp-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

#screen-homeenergy .weather-plan .wp-head .eyebrow {
  white-space: nowrap;
}

/* The three limit chips repeat what "Change limits" opens, so the card keeps to the plan, the money and the week. */
#screen-homeenergy .weather-plan .wp-chips {
  display: none;
}

/* The Powerwall tile on the hub: "64%" and "8.7 of 13.5 kWh" on lines of their own on a narrow phone, never a
   dangling "·". */
#screen-homeenergy .energy-tile-sep {
  white-space: nowrap;
}

@media (max-width: 379px) {
  #screen-homeenergy .energy-tile-sep {
    display: none;
  }

  #screen-homeenergy .energy-tile-part {
    display: block;
  }
}

/* Today's plan: the rows under the chart say what the car and the Powerwall do, so the long sentence above them that
   said it all again stays out of the way (it still reads out where there are no rows). */
#screen-homeenergy .day-plan:has(.dp-rows .dp-row) .dp-sentence {
  display: none;
}

/* Today's plan chart: the "Price" lane label and the hour labels are HTML at a readable 11px under/over the chart. */
.day-plan .dp-lane {
  margin: 10px 0 0;
  color: var(--v-tx3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.day-plan .dp-ticks {
  position: relative;
  height: 16px;
  margin-top: 4px;
}

.day-plan .dp-ticks .dp-tick {
  position: absolute;
  top: 0;
  color: var(--v-tx3);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

/* A long home name ("Grandma's Lake Cottage on the Hill · Updated just now") wraps instead of pushing the card wider
   than the phone. */
#screen-homeenergy #homeEnergyCard .he-foot > span:first-child {
  min-width: 0;
  white-space: normal;
}

/* The sheet sits behind the tab bar, so its last control scrolls clear of it on short phones. */
#screen-garage.charge-sheet.active {
  padding-bottom: calc(var(--v-tabbar, 76px) + 16px);
}

/* Open charge port is a live link: bright when it can be used, quiet only when it can't. */
#screen-garage .charge-port-link:not(:disabled) {
  color: #7DB8FF;
  font-weight: 650;
}

#screen-garage .charge-port-link:disabled {
  color: rgba(255, 255, 255, 0.38);
}

/* Why the buttons can't be used, or what the last start is doing. */
#screen-garage .charge-command-note {
  margin: 10px 2px 0;
  color: var(--v-tx-2, rgba(255, 255, 255, 0.72));
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

#screen-garage .charge-command-note[data-tone="warn"] {
  color: #FFB547;
}

#screen-garage .charge-command-note.hidden {
  display: none;
}

/* Home energy's first read on Today: two shimmering bars under the card's words while Tesla answers. */
:is(.home-energy-card, .pp-empty) .he-skeleton {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

:is(.home-energy-card, .pp-empty) .he-skeleton i {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  background-size: 200% 100%;
  animation: fleet-shimmer 1.4s linear infinite;
}

:is(.home-energy-card, .pp-empty) .he-skeleton i:last-child {
  width: 60%;
}

@media (prefers-reduced-motion: reduce) {
  :is(.home-energy-card, .pp-empty) .he-skeleton i {
    animation: none;
  }
}

/* Energy summary: today's energy in and out as a 2x2 list, and (without VueRate Home) one card saying what the plan adds. */
#screen-homeenergy .home-energy-summary .hes-today,
#screen-homeenergy .home-energy-summary .hes-plan {
  display: grid;
  gap: 10px;
  border-radius: var(--radius-card, 16px);
  padding: 16px;
  background: var(--surface);
  min-width: 0;
}

#screen-homeenergy .hes-today dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin: 0;
}

#screen-homeenergy .hes-today dl > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#screen-homeenergy .hes-today dt {
  color: var(--v-tx3, rgba(255, 255, 255, 0.6));
  font-size: 12.5px;
}

#screen-homeenergy .hes-today dd {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#screen-homeenergy .hes-plan p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

#screen-homeenergy .hes-plan .plan-badge { justify-self: start; }

#screen-homeenergy .hes-plan .hes-plan-chip {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(255, 181, 71, 0.16);
  color: #FFC37A;
  font-size: 12px;
  font-weight: 700;
}

#screen-homeenergy .hes-plan .secondary-action {
  justify-self: stretch;
}

/* The worth row's chevron keeps its own width at 320 px. */
#screen-homeenergy .hes-worth .hes-go {
  flex: 0 0 auto;
  min-width: 12px;
  text-align: center;
}

/* Powerwall detail sheet: the column is the screen's width, never its widest child's (it ran 6 px off at 320). */
.he-detail-body {
  grid-template-columns: minmax(0, 1fr);
}

.he-detail-body > *,
.he-detail-hero > *,
.he-detail-body .he-section > * {
  min-width: 0;
}

/* On the Powerwall page the live card starts at Today (its flow and headline are the hub's), so no divider above it. */
#screen-homeenergy [data-slot="homeEnergyCard"] .he-today {
  border-top: 0;
  padding-top: 0;
}

/* The Weather plan's limits lay out the same on its hub page as on Plan: the label takes the room, the select stays compact. */
#screen-homeenergy .weather-plan .wp-limit > span {
  flex: 1 1 auto;
  min-width: 0;
}

#screen-homeenergy .weather-plan .wp-limit select {
  flex: none;
  width: auto;
}

/* A home without a car: Me's account sheet hides the rows that only mean something for a car. */
body[data-home-only="true"] #accountTargetEditButton,
body[data-home-only="true"] .settings-row:has(#autoScheduleToggle),
body[data-home-only="true"] .settings-row:has(#settingsGuarantee) {
  display: none;
}

/* Energy summary reads as one card of rows: a hairline between them instead of wide gaps. */
#screen-homeenergy .home-energy-summary:not(.hidden) {
  gap: 0;
  overflow: hidden;
}
#screen-homeenergy .home-energy-summary.home-energy-summary > * { border-radius: 0; }
#screen-homeenergy .home-energy-summary.home-energy-summary > * + * { border-top: 1px solid var(--v-line); }

/* Home energy's switches are the same green as the rest of the app. */
#screen-homeenergy .autopilot-switch input:checked,
#screen-device .powerwall-plan .autopilot-switch input:checked { background: var(--v-mint2); }

/* Never below: the chevron keeps its place inside the box. */
:is(#screen-homeenergy .weather-plan, #screen-device .powerwall-plan) .wp-limit select {
  padding-right: 34px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23AAB4C8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 11px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

/* Short copy breaks evenly, so a last word never sits on its own line. */
#screen-homeenergy .energy-page :is(p, small) { text-wrap: pretty; }
#screen-homeenergy .energy-page :is(h3, h4, strong) { text-wrap: balance; }
