/* Vivid redesign: Plan (#screen-device). Loaded after styles-vivid.css; scope every rule to this area.
   One job: what happens tonight and how to change it. Top to bottom: the car hero (tonight's hours big, the goal in a
   line, the price curve with the charging hours, the skipped spikes and the limit), When to charge as a segmented
   control, three stat tiles while Autopilot has a plan, the battery goal slider with Ready by, the price limits, Take
   control, Autopilot (a VueRate Drive invite on Free), the vehicle row and the utility row. Mockup: 02-plan. */

/* ---------- Layout ---------- */
#screen-device.active {
  gap: 14px;
}

#screen-device.active > .screen-heading {
  margin-bottom: 0;
}

#screen-device > #chargingPlanTonight { order: 2; }
#screen-device > #planViewOnly { order: 2; }
#screen-device > #chargingPlanCard { order: 3; }
#screen-device > #planTakeControlButton { order: 3; margin-top: 0; }
#screen-device > #planAutopilotCard { order: 4; }
#screen-device > #scheduleTargetCard { order: 5; }
#screen-device > #planRateContextCard { order: 6; }
/* On Free (or VueRate Home) the Autopilot invite is the screen's one job, so it sits right under the hero instead of
   below the settings. With Autopilot off on a paid plan, the hero's own Turn on Autopilot button does that job. */
#screen-device > #planAutopilotCard.is-locked:not(.is-muted) { order: 2; }

#screen-device .hidden {
  display: none !important;
}

/* "Why this plan": a glass circle next to Vera, 44px to tap. */
#screen-device #scheduleAiButton {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--v-line);
  border-radius: 50%;
  color: var(--v-tx2);
  background: var(--v-card2);
}

/* ---------- Hero: tonight's plan ---------- */
#screen-device .pv-hero {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px 18px 16px;
}

#screen-device .pv-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
}

#screen-device .pv-hero .v-eyebrow {
  color: rgba(255, 255, 255, 0.9);
}

#screen-device #planHeroChip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v-mint);
  box-shadow: 0 0 8px var(--v-mint);
}

/* The headline: tonight's hours, or what's happening, at 800. */
#screen-device #chargingPlanTonight #chargingPlanTonightText {
  display: block;
  margin: 10px 0 0;
  color: #fff;
  font-size: clamp(24px, 7.4vw, 30px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

#screen-device #chargingPlanTonight.has-runs #chargingPlanTonightText {
  font-size: clamp(34px, 11vw, 46px);
  line-height: 1;
  letter-spacing: -0.045em;
}

#screen-device #chargingPlanTonight.has-runs.is-multi #chargingPlanTonightText {
  font-size: clamp(26px, 8.4vw, 34px);
  line-height: 1.08;
}

#screen-device #chargingPlanTonightText .plan-hours-run,
#screen-device #chargingPlanTonightText .pv-more {
  white-space: nowrap;
}

#screen-device #chargingPlanTonightText .pv-more {
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.9;
}

#screen-device .pv-hero-sub {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.4;
}

/* #chargingPlanTitle: the goal ("80% by 7 AM"), now a bold phrase in the line under the hours. */
#screen-device #chargingPlanTonight #chargingPlanTitle {
  display: inline;
  margin: 0;
  color: #fff;
  font-size: inherit;
  font-weight: 800;
  line-height: inherit;
  letter-spacing: 0;
  white-space: nowrap;
}

#screen-device .pv-hero-meta,
#screen-device #chargingPlanTonight .pv-hero-note {
  display: block;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

#screen-device .pv-hero-meta {
  font-weight: 600;
}

/* The action on the hero (Turn on Autopilot, Let VueRate handle timing): white, the one solid button on blue. */
#screen-device #chargingPlanTonight .pv-hero-action {
  align-self: flex-start;
  max-width: 100%;
  margin-top: 14px;
  border-color: transparent;
  color: #0B2A6B;
  background: #fff;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  white-space: normal;
  text-align: center;
}

/* ---------- Price curve ---------- */
#screen-device .pv-chart {
  margin-top: 18px;
}

#screen-device .pv-plot {
  position: relative;
  height: 104px;
}

#screen-device .pv-chart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

#screen-device .pv-chart-svg path {
  stroke-linecap: round;
  stroke-linejoin: round;
}

#screen-device .pv-chart-svg .plan-curve-fill {
  stroke: none;
}

#screen-device .pv-chart-svg .plan-curve-line {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7));
}

#screen-device .pv-chart-svg .plan-limit-line {
  fill: none;
  stroke: #FFC27A;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.95;
}

/* Bars: one per hour, from the curve down. Charging is pale blue, a skipped spike amber. */
#screen-device .plan-bar {
  position: absolute;
  bottom: 0;
  box-sizing: border-box;
  border-left: 1.5px solid transparent;
  border-right: 1.5px solid transparent;
  background-clip: padding-box;
  border-radius: 4px 4px 2px 2px;
}

#screen-device .plan-bar.on {
  background-image: linear-gradient(180deg, #B8E0FF, rgba(125, 184, 255, 0.28));
}

#screen-device .plan-bar.on.soft {
  background-image: linear-gradient(180deg, rgba(184, 224, 255, 0.55), rgba(125, 184, 255, 0.1));
}

#screen-device .plan-bar.skip {
  background-image: linear-gradient(180deg, #FFB547, rgba(255, 122, 31, 0.22));
}

#screen-device .pv-plot.flat {
  border-radius: 12px;
  background: rgba(0, 8, 30, 0.28);
}

#screen-device .pv-now {
  position: absolute;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.25), 0 0 16px #fff;
}

#screen-device .pv-ready {
  position: absolute;
  top: -4px;
  bottom: 0;
  width: 0;
  border-left: 1.5px dashed rgba(255, 255, 255, 0.75);
}

#screen-device .pv-low,
#screen-device .pv-limit {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

#screen-device .pv-low {
  margin-top: -30px;
  padding: 2px 7px;
  border-radius: 8px;
  color: #fff;
  background: rgba(8, 20, 50, 0.78);
  transform: translateX(-50%);
}

#screen-device .pv-limit {
  right: 0;
  margin-top: -20px;
  color: #FFD3A0;
}

#screen-device .pv-axis {
  position: relative;
  height: 16px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

#screen-device .pv-axis em {
  position: absolute;
  top: 0;
  font-style: normal;
  transform: translateX(-50%);
}

#screen-device .pv-axis em.start {
  transform: none;
}

#screen-device .pv-axis em.end {
  transform: translateX(-100%);
}

#screen-device .pv-axis em.ready {
  color: #fff;
  font-weight: 750;
}

/* The night bar when there are no prices: the hours band and the ready-by mark, in the hero's glass. */
#screen-device .pv-chart-night .plan-night-track {
  position: relative;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 8, 30, 0.3);
}

#screen-device .pv-chart-night .plan-night-band {
  position: absolute;
  top: 10px;
  bottom: 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #B8E0FF, rgba(125, 184, 255, 0.5));
}

#screen-device .pv-chart-night .plan-night-band.soft {
  background: rgba(184, 224, 255, 0.3);
}

#screen-device .pv-chart-night .plan-night-band::after {
  content: none;
}

#screen-device .pv-chart-night .plan-night-ready {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 0;
  border-left: 1.5px dashed #fff;
}

#screen-device .pv-chart-night .plan-night-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
}

#screen-device .pv-chart-night .plan-night-axis em {
  font-style: normal;
  white-space: nowrap;
}

#screen-device #chargingPlanTonight .pv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
}

#screen-device .pv-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#screen-device .pv-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #B8E0FF;
}

#screen-device .pv-legend .skip i {
  background: #FFB547;
}

#screen-device .pv-legend .ready i {
  width: 0;
  height: 12px;
  border-left: 1.5px dashed #fff;
  border-radius: 0;
  background: none;
}

/* ---------- View only (a shared account seen as a viewer) ---------- */
#screen-device .pv-view-only {
  margin: 0;
  padding: 12px 14px;
  color: var(--v-tx2);
  font-size: 14px;
  line-height: 1.4;
}

#screen-device #chargingPlanCard :is(input, select):disabled,
#screen-device #planAutopilotCard input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- When to charge ---------- */
#screen-device .pv-plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
}

#screen-device .pv-when {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#screen-device .pv-when legend {
  float: left;
  width: 100%;
  margin: 4px 0 8px;
  padding: 0 4px;
}

#screen-device .pv-seg > label {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0 4px;
  border-radius: 12px;
  color: var(--v-tx2);
  font-size: clamp(14px, 4.2vw, 15px);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

#screen-device .pv-seg > label strong {
  font-weight: inherit;
}

#screen-device .pv-seg > label input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

#screen-device .pv-seg > label.on {
  color: #fff;
  background: linear-gradient(160deg, #2D6FE0, #1A4FC4);
  box-shadow: 0 6px 18px -6px rgba(61, 139, 255, 0.8);
}

#screen-device .pv-seg > label:has(input:focus-visible) {
  outline: 2px solid var(--v-car2);
  outline-offset: 2px;
}

#screen-device .pv-seg > label.needs-setup:not(.on) {
  color: var(--v-tx3);
}

#screen-device .pv-when-copy {
  margin: 0;
  padding: 0 4px;
  color: var(--v-tx2);
  font-size: 13px;
  line-height: 1.4;
}

#screen-device .pv-when-copy:empty {
  display: none;
}

#screen-device .pv-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px 10px 16px;
}

#screen-device .pv-row-label {
  font-size: 16px;
  font-weight: 700;
}

#screen-device .pv-window-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#screen-device .pv-to {
  color: var(--v-tx2);
  font-size: 14px;
}

/* Selects as value pills with a chevron. */
#screen-device .pv-select {
  position: relative;
  display: inline-flex;
  flex: none;
}

#screen-device .pv-select select {
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 32px 0 14px;
  border: 1px solid var(--v-line);
  border-radius: 14px;
  color: var(--v-tx);
  background: var(--v-raised);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

#screen-device .pv-select.small select {
  height: 40px;
  padding: 0 28px 0 11px;
  border-radius: 12px;
  font-size: 15px;
}

#screen-device .pv-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid var(--v-tx2);
  border-bottom: 2px solid var(--v-tx2);
  transform: rotate(45deg);
  pointer-events: none;
}

#screen-device .pv-select.small::after {
  right: 11px;
}

#screen-device .pv-select select:focus-visible {
  outline: 2px solid var(--v-car2);
  outline-offset: 2px;
}

/* ---------- Stats: Est. cost / Adds / Battery now ---------- */
#screen-device .pv-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#screen-device .pv-stats[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#screen-device .pv-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--v-r-inner);
}

#screen-device .pv-stat .v-lbl {
  font-size: clamp(12px, 3.6vw, 13px);
}

#screen-device .pv-stat .v-val {
  font-size: clamp(17px, 5.2vw, 20px);
}

/* ---------- Battery goal ---------- */
#screen-device .pv-goal-card {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 8px;
}

#screen-device .pv-goal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#screen-device .pv-goal-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* The slider: a 6px track filled blue up to the goal, a white 28px thumb with a soft halo, 48px to touch. */
#screen-device .pv-range {
  --fill: 60%;
  width: 100%;
  height: 48px;
  margin: 2px 0 0;
  padding: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

#screen-device .pv-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1A4FC4, #7DB8FF) 0 0 / var(--fill) 100% no-repeat, var(--v-raised);
}

#screen-device .pv-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1A4FC4, #7DB8FF) 0 0 / var(--fill) 100% no-repeat, var(--v-raised);
}

#screen-device .pv-range::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(125, 184, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.4);
  -webkit-appearance: none;
}

#screen-device .pv-range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(125, 184, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.4);
}

#screen-device .pv-range:focus-visible {
  outline: none;
}

#screen-device .pv-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px #0b1220, 0 0 0 6px #7db8ff, 0 4px 10px rgba(0, 0, 0, 0.4);
}

#screen-device .pv-range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px #0b1220, 0 0 0 6px #7db8ff, 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* 50% / Daily (at 80%, the everyday goal) / 100%. */
#screen-device .pv-range-scale {
  position: relative;
  height: 16px;
  color: var(--v-tx3);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

#screen-device .pv-range-scale span {
  position: absolute;
  top: 0;
}

#screen-device .pv-range-scale span:first-child {
  left: 0;
}

#screen-device .pv-range-scale .pv-daily {
  left: calc(14px + (100% - 28px) * 0.6);
  color: var(--v-car2);
  transform: translateX(-50%);
}

#screen-device .pv-range-scale span:last-child {
  right: 0;
}

#screen-device .pv-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  margin-top: 10px;
  border-top: 1px solid var(--v-line);
  cursor: pointer;
}

/* ---------- Limits: Skip price spikes, Charge when power is free ---------- */
#screen-device .pv-limits {
  display: flex;
  flex-direction: column;
  padding: 4px 16px;
}

#screen-device .pv-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

#screen-device .pv-toggle:not(.hidden) ~ .pv-toggle {
  border-top: 1px solid var(--v-line);
}

#screen-device .pv-toggle-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#screen-device .pv-cap-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

#screen-device .pv-cap-hint {
  color: var(--v-tx3);
  font-size: 13px;
  line-height: 1.4;
}

#screen-device .v-switch:focus-visible {
  outline: 2px solid var(--v-car2);
  outline-offset: 2px;
}

/* ---------- Take control: a calm row (the hero holds the one bright action) ---------- */
#screen-device #planTakeControlButton:not(.hidden) {
  min-height: 64px;
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  color: var(--v-tx);
  background: var(--v-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#screen-device #planTakeControlButton .plan-take-control-copy {
  flex: 1;
  min-width: 0;
}

#screen-device #planTakeControlButton .plan-take-control-copy strong {
  color: var(--v-tx);
  font-size: 16px;
  font-weight: 700;
}

#screen-device #planTakeControlButton .plan-take-control-copy small {
  color: var(--v-tx2);
}

#screen-device #planTakeControlButton .plan-take-control-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(61, 139, 255, 0.18);
}

#screen-device #planTakeControlButton .plan-take-control-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--v-car2);
}

#screen-device #planTakeControlButton .plan-take-control-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--v-tx3);
  stroke-width: 2;
}

/* ---------- Autopilot ---------- */
#screen-device .pv-autopilot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 1;
}

#screen-device .pv-autopilot.is-muted {
  opacity: 0.6;
}

#screen-device .pv-autopilot-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

#screen-device .v-ico svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#screen-device .pv-autopilot-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#screen-device .pv-autopilot-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

/* Free: the card is an invite to VueRate Drive, in its car blue, with what Autopilot could save. */
#screen-device .pv-autopilot.is-locked {
  border-color: rgba(61, 139, 255, 0.35);
  background: linear-gradient(140deg, rgba(61, 139, 255, 0.2), rgba(61, 139, 255, 0.03) 70%), var(--v-card);
}

#screen-device .pv-invite-save {
  margin: 0;
  color: var(--v-tx);
  font-size: 14px;
  line-height: 1.45;
}

#screen-device .pv-invite-save b {
  color: var(--v-mint);
  font-weight: 750;
}

#screen-device .pv-invite-button {
  width: 100%;
  white-space: normal;
  text-align: center;
}

/* "See VueRate Drive · $2.99/mo" stays on one line on the narrowest phones. */
@media (max-width: 350px) {
  #screen-device .pv-invite-button {
    padding-inline: 8px;
    font-size: 15px;
  }
}

/* ---------- Vehicle and utility rows ---------- */
#screen-device .pv-vehicle,
#screen-device .pv-rates-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

#screen-device .pv-vehicle {
  padding: 12px 12px 12px 16px;
}

#screen-device .pv-vehicle-copy,
#screen-device .pv-rates-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#screen-device .pv-vehicle-copy .v-ttl,
#screen-device .pv-rates-copy .v-ttl {
  overflow-wrap: break-word;
}

#screen-device #scheduleTargetButton {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

#screen-device .pv-rates {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-device .pv-rates-text {
  margin: 0;
  line-height: 1.45;
}

#screen-device #planRateContextChip {
  flex: none;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--v-line);
  color: var(--v-tx2);
  background: var(--v-card2);
  font-size: 12px;
  white-space: nowrap;
}

#screen-device #planRateContextButton {
  align-self: flex-start;
}

/* ---------- Home-only: the Powerwall plan leads; the car plan stays hidden ---------- */
body[data-home-only="true"] #screen-device :is(#chargingPlanTonight, #chargingPlanCard, #scheduleTargetCard, #planAutopilotCard, #planViewOnly) {
  display: none !important;
}

/* The legacy input rules give every input a box; the slider is only its track and thumb. */
#screen-device #chargingPlanTarget.pv-range {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* A narrow phone with a long button ("Pick vehicle") puts the button on its own line rather than squeezing the name. */
#screen-device .pv-vehicle {
  flex-wrap: wrap;
}

#screen-device .pv-vehicle-copy {
  flex: 1 1 100px;
}

#screen-device .pv-rates-head {
  flex-wrap: wrap;
}

#screen-device .pv-rates-copy {
  flex: 1 1 100px;
}

#screen-device #planRateContextButton:not(.hidden) {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(160deg, #3D8BFF, #1A4FC4);
  box-shadow: 0 8px 24px -10px rgba(61, 139, 255, 0.9);
  font-weight: 650;
}

/* Without a vehicle, the hero's Connect button and the row's Pick vehicle say it; no extra "Setup" chip. */
#screen-device #scheduleTargetReadiness {
  display: none;
}

/* View only: the segmented control dims as a whole; its radios stay invisible. */
#screen-device .pv-seg > label input:disabled {
  opacity: 0;
}

#screen-device .pv-seg:has(input:disabled) {
  opacity: 0.55;
}

/* ---------- Sheets opened from Plan ---------- */
/* Why this plan: the reasons as a short list with car-blue icons, then one "Got it". */
#aiAssistantOverlay .pv-why-title,
#targetPickerOverlay .pv-why-title {
  margin-top: 4px;
  font-size: clamp(24px, 7vw, 28px);
}

#aiAssistantOverlay .pv-why-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

#aiAssistantOverlay .pv-why-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--v-tx);
  font-size: 15px;
  line-height: 1.45;
}

#aiAssistantOverlay .pv-why-list li > span:last-child {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

#aiAssistantOverlay .v-ico svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#aiAssistantOverlay .pv-why-done {
  width: 100%;
  min-height: 50px;
  margin-top: 22px;
}

/* Pick your car: one card per car, the chosen one lit blue. */
#targetPickerOverlay .target-option {
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-inner);
  background: var(--v-card2);
}

#targetPickerOverlay .target-option.active {
  border-color: rgba(61, 139, 255, 0.6);
  background: linear-gradient(140deg, rgba(61, 139, 255, 0.24), rgba(61, 139, 255, 0.05) 70%), var(--v-card2);
}

/* Schedule editor (opened from Me): vivid pickers and value fields. */
#scheduleEditorOverlay .time-window-picker select,
#scheduleEditorOverlay .setting-line input {
  border: 1px solid var(--v-line);
  border-radius: 14px;
  color: var(--v-tx);
  background: var(--v-raised);
  font-weight: 700;
}

#scheduleEditorOverlay .time-window-track {
  border-radius: 10px;
  background: var(--v-raised);
}

#scheduleEditorOverlay .schedule-editor-target-card {
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-inner);
  background: var(--v-card2);
}

/* ---------- Home-only: the Powerwall plan in the home's sun amber ---------- */
#screen-device #powerwallPlan:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-device #powerwallPlan > section {
  margin: 0;
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  background: var(--v-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#screen-device #powerwallPlan > .weather-plan {
  border-color: rgba(255, 181, 71, 0.3);
  background: linear-gradient(140deg, rgba(255, 140, 40, 0.2), rgba(255, 140, 40, 0.03) 70%), var(--v-card);
}

#screen-device #powerwallPlan :is(.primary-action, .secondary-action) {
  border: 0;
  border-radius: 999px;
  color: #1A0E02;
  background: linear-gradient(160deg, #FFC56B, #FF9A3D);
  box-shadow: 0 8px 22px -12px rgba(255, 140, 40, 0.9);
  font-weight: 700;
}

#screen-device #powerwallPlan h3 {
  font-weight: 750;
  letter-spacing: -0.01em;
}

#targetPickerOverlay #targetPickerSaveButton {
  border: 0;
  color: #fff;
  background: linear-gradient(160deg, #3D8BFF, #1A4FC4);
  box-shadow: 0 8px 24px -10px rgba(61, 139, 255, 0.9);
}

/* The radio under each segment never draws (legacy disabled-input rules give it a ring otherwise). */
#screen-device .pv-seg > label input {
  border: 0;
  background: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

/* One bright button on the Powerwall plan: the Weather plan's. Ways to save and the settings presets are amber
   outlines, so they read as options rather than three equal calls to act. */
#screen-device #powerwallPlan > :not(.weather-plan) :is(.primary-action, .secondary-action) {
  border: 1px solid rgba(255, 181, 71, 0.55);
  color: #FFC56B;
  background: rgba(255, 140, 40, 0.08);
  box-shadow: none;
}

#screen-device #powerwallPlan > :not(.weather-plan) [data-he-confirm].primary-action {
  border: 0;
  color: #1A0E02;
  background: linear-gradient(160deg, #FFC56B, #FF9A3D);
}

/* Powerwall settings folded behind one row. */
#screen-device #powerwallPlan > .pp-settings {
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  background: var(--v-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#screen-device #powerwallPlan > .pp-settings > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

#screen-device #powerwallPlan > .pp-settings > summary::-webkit-details-marker {
  display: none;
}

#screen-device #powerwallPlan > .pp-settings > summary .v-ico {
  flex: 0 0 auto;
}

#screen-device #powerwallPlan .pp-settings-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

#screen-device #powerwallPlan > .pp-settings > summary .v-chev {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--v-tx3);
  stroke-width: 2;
  transition: transform 0.2s ease;
}

#screen-device #powerwallPlan > .pp-settings[open] > summary .v-chev {
  transform: rotate(90deg);
}

#screen-device #powerwallPlan > .pp-settings > .he-section {
  margin: 0;
  padding: 4px 16px 16px;
  border: 0;
  border-top: 1px solid var(--v-line);
  border-radius: 0;
  background: none;
}

#screen-device #powerwallPlan > .pp-settings > summary:focus-visible {
  outline: 2px solid #FFC56B;
  outline-offset: -2px;
  border-radius: var(--v-r-card);
}

/* Every button on the Powerwall plan is at least 44px to tap. */
#screen-device #powerwallPlan :is(button, select) {
  min-height: 44px;
}

/* The schedule editor's Review block only repeated the car and hours shown just above it. */
.schedule-editor-review {
  display: none;
}
