/* Vivid redesign: Me, sheets, sign-in, two-step and plans (#screen-settings and overlays). Loaded after styles-vivid.css; scope every rule to this area.
   Also the app-wide primary / secondary / ghost button: this file loads last, so one rule set here gives every
   primary action in the app the same vivid look (blue gradient, white text, at least 48px, pill). */

/* =====================================================================================================================
   Buttons, app-wide
   ===================================================================================================================== */
:root {
  --vme-primary: linear-gradient(160deg, #4A95FF 0%, #2A6BEB 55%, #1A4FC4 100%);
  --vme-primary-press: linear-gradient(160deg, #3D86F5 0%, #2260DA 55%, #1745AE 100%);
  --vme-primary-glow: 0 10px 26px -12px rgba(61, 139, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* The calm layers paint primaries light blue with dark text, some with ids or !important. One rule beats them all. */
html body :is(.primary-action, .signin-primary, .two-step-primary, .auth-primary-button, .shared-access-btn.primary, .app-lock-button):not(.charge-start-button):not(.v-keep) {
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding-inline: 20px;
  color: #fff !important;
  background: #2563E0 var(--vme-primary) !important;
  box-shadow: var(--vme-primary-glow) !important;
  font-family: var(--v-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-shadow: 0 1px 1px rgba(0, 20, 70, 0.25);
  -webkit-tap-highlight-color: transparent;
}

html body :is(.primary-action, .signin-primary, .two-step-primary, .auth-primary-button, .shared-access-btn.primary, .app-lock-button):not(.charge-start-button):not(.v-keep) svg {
  color: #fff;
  stroke: currentColor;
}

html body :is(.primary-action, .signin-primary, .two-step-primary, .auth-primary-button, .shared-access-btn.primary, .app-lock-button):not(.charge-start-button):not(:disabled):active {
  background: #1F57C9 var(--vme-primary-press) !important;
  transform: scale(0.985);
}

html body :is(.primary-action, .signin-primary, .two-step-primary, .auth-primary-button, .shared-access-btn.primary, .app-lock-button):not(.charge-start-button):focus-visible {
  outline: 3px solid rgba(125, 184, 255, 0.7);
  outline-offset: 2px;
}

html body :is(.primary-action, .signin-primary, .two-step-primary, .auth-primary-button, .shared-access-btn.primary):not(.charge-start-button):disabled {
  opacity: 0.5;
  box-shadow: none !important;
  text-shadow: none;
}

/* Busy primaries keep their colour so "Paying…" still reads as the main action. */
html body :is(.primary-action, .signin-primary, .two-step-primary).is-loading:disabled,
html body :is(.primary-action, .signin-primary, .two-step-primary).is-busy:disabled {
  opacity: 0.82;
}

html body .auth-gate .signin-spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

/* Secondary: dark glass with a hairline. Same height and radius as the primary. */
html body :is(.secondary-action, .two-step-secondary):not(.v-keep) {
  min-height: 48px !important;
  border: 1px solid var(--v-line-strong) !important;
  border-radius: 999px !important;
  padding-inline: 20px;
  color: var(--v-tx) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  font-family: var(--v-font);
  font-size: 15px;
  font-weight: 650;
}

html body :is(.secondary-action, .two-step-secondary):not(:disabled):active {
  background: rgba(255, 255, 255, 0.1) !important;
}

html body :is(.secondary-action, .two-step-secondary):disabled {
  opacity: 0.5;
}

/* Ghost: text only, in the car blue. */
html body :is(.signin-link, .two-step-link) {
  min-height: 44px;
  color: var(--v-car2);
  font-weight: 650;
}

html body :is(.primary-action, .secondary-action).compact {
  min-height: 48px;
}

/* =====================================================================================================================
   Me (#screen-settings), mockup 07
   ===================================================================================================================== */
#screen-settings .screen-heading h2 {
  font-size: clamp(30px, 8.8vw, 34px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

#screen-account .account-page-hero h2 {
  font-weight: 800;
  letter-spacing: -0.03em;
}

#screen-settings .screen-heading .calm-kicker {
  margin-bottom: 2px;
}

/* Profile card: the car-to-home gradient, a big initial, name and plan, a plan badge and a chip for each area. */
#screen-settings .settings-profile-hero {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  min-height: 0;
  margin: 4px 0 26px;
  border: 1px solid var(--v-line-strong) !important;
  border-radius: var(--v-r-hero);
  padding: 18px 16px 16px;
  color: var(--v-tx);
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(255, 154, 47, 0.16), transparent 70%),
    linear-gradient(135deg, rgba(61, 139, 255, 0.24), rgba(255, 154, 47, 0.1) 70%, rgba(59, 232, 166, 0.08)),
    var(--v-card) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 40px -24px rgba(61, 139, 255, 0.55) !important;
  text-align: left;
}

#screen-settings .settings-profile-hero:hover,
#screen-settings .settings-profile-hero:focus-visible,
#screen-settings .settings-profile-hero:active {
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(255, 154, 47, 0.2), transparent 70%),
    linear-gradient(135deg, rgba(61, 139, 255, 0.3), rgba(255, 154, 47, 0.12) 70%, rgba(59, 232, 166, 0.1)),
    var(--v-card) !important;
}

#screen-settings .me-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

#screen-settings .settings-profile-hero .settings-account-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(140deg, #2F6FE0, #1A4FC4 55%, #C2600F);
  box-shadow: 0 8px 20px -6px rgba(61, 139, 255, 0.6);
  font-size: 22px;
  font-weight: 800;
}

#screen-settings .me-profile-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

#screen-settings .settings-profile-hero #settingsAccountName {
  max-width: 100%;
  color: var(--v-tx);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: break-word;
}

/* The plan line reads as text under the name ("VueRate One · Monthly"), not as another pill. */
#screen-settings .settings-profile-hero .settings-plan-chip {
  margin: 0;
  border-radius: 0;
  padding: 0;
  color: var(--v-tx2) !important;
  background: none !important;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.35;
}

#screen-settings .settings-profile-hero .settings-plan-chip[data-tone="warn"] {
  color: var(--v-sun) !important;
}

#screen-settings .settings-profile-hero #settingsAccountEmail {
  max-width: 100%;
  color: var(--v-tx2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#screen-settings .me-plan-badge {
  flex: none;
  align-self: flex-start;
  margin-top: 6px;
  border-radius: 999px;
  padding: 5px 11px;
  color: #0A0E15;
  background: #FFC86A linear-gradient(90deg, #FFE29A, #FFB547);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

#screen-settings .me-plan-badge[data-plan="drive"] {
  color: #fff;
  background: #2A6BEB linear-gradient(160deg, #3D8BFF, #1A4FC4);
}

#screen-settings .me-plan-badge[data-plan="home"] {
  color: var(--v-ink-amber);
  background: #FFB04D linear-gradient(90deg, #FFC56B, #FF9A2F);
}

#screen-settings .me-area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

#screen-settings .me-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 5px 12px;
  color: #fff;
  background: rgba(61, 139, 255, 0.2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: break-word;
}

#screen-settings .me-chip.sun {
  background: rgba(255, 181, 71, 0.16);
}

#screen-settings .me-chip.mint {
  background: rgba(59, 232, 166, 0.14);
}

/* Group labels: the vivid eyebrow. */
#screen-settings .settings-group-label,
#screen-account .settings-group-label {
  margin: 0 0 8px;
  padding: 0 4px;
  color: var(--v-tx2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

#screen-settings .settings-landing-group,
#screen-account > .settings-landing-group {
  margin: 0 0 24px;
}

#screen-settings .settings-landing-list,
#screen-account .settings-landing-list {
  border: 1px solid var(--v-line) !important;
  border-radius: var(--v-r-card);
  background: var(--v-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

#screen-settings .settings-route-row,
#screen-account .settings-route-row {
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 10px 14px;
}

#screen-settings .settings-route-row.app-lock-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

/* Hairlines start under the text, as in the mockup. */
#screen-settings .settings-route-row + .settings-route-row,
#screen-account .settings-route-row + .settings-route-row {
  border-top: 0;
  background-image: linear-gradient(var(--v-line), var(--v-line));
  background-repeat: no-repeat;
  background-position: 62px 0;
  background-size: calc(100% - 62px) 1px;
}

#screen-settings .settings-route-row strong,
#screen-account .settings-route-row strong {
  color: var(--v-tx);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

#screen-settings .settings-route-row small,
#screen-account .settings-route-row small {
  color: var(--v-tx2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

/* Icon tiles in each area's colour. */
#screen-settings .settings-route-icon,
#screen-account .settings-route-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--v-r-small);
  color: var(--v-tx);
  background: rgba(255, 255, 255, 0.08);
}

#screen-settings .settings-route-icon svg,
#screen-account .settings-route-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#screen-settings .settings-route-icon.tone-car,
#screen-account .settings-route-icon.tone-car {
  color: var(--v-car2);
  background: rgba(61, 139, 255, 0.18);
}

#screen-settings .settings-route-icon.tone-mint,
#screen-account .settings-route-icon.tone-mint {
  color: var(--v-mint);
  background: rgba(59, 232, 166, 0.15);
}

#screen-settings .settings-route-icon.tone-sun,
#screen-account .settings-route-icon.tone-sun {
  color: var(--v-sun);
  background: rgba(255, 181, 71, 0.16);
}

#screen-settings .settings-route-icon.tone-storm,
#screen-account .settings-route-icon.tone-storm {
  color: var(--v-storm);
  background: rgba(166, 148, 255, 0.17);
}

#screen-settings .utility.tone-mint svg {
  fill: currentColor;
  stroke: none;
}

#screen-settings .settings-route-chevron,
#screen-account .settings-route-chevron {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--v-tx3);
}

#screen-settings .settings-route-chevron svg,
#screen-account .settings-route-chevron svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The fingerprint switch is the mockup switch: mint when on. Alerts and the account sheet use the same one. */
:is(#screen-settings, #alertsOverlay, #accountSettingsOverlay) .autopilot-switch input {
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: #3A4458;
}

:is(#screen-settings, #alertsOverlay, #accountSettingsOverlay) .autopilot-switch input::after {
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

:is(#screen-settings, #alertsOverlay, #accountSettingsOverlay) .autopilot-switch input:checked {
  background: var(--v-mint2);
}

:is(#screen-settings, #alertsOverlay, #accountSettingsOverlay) .autopilot-switch input:checked::after {
  background: #fff;
}

/* =====================================================================================================================
   Account page (#screen-account)
   ===================================================================================================================== */
#screen-account .account-page-back {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 16px 0 8px;
  color: #fff;
  background: var(--v-raised);
  font-size: 15px;
  font-weight: 650;
}

#screen-account .account-page-hero {
  border: 1px solid var(--v-line-strong);
  border-radius: var(--v-r-hero);
  padding: 22px 16px 18px;
  background:
    linear-gradient(135deg, rgba(61, 139, 255, 0.24), rgba(255, 154, 47, 0.1) 70%, rgba(59, 232, 166, 0.08)),
    var(--v-card);
}

#screen-account .account-page-avatar {
  color: #fff;
  background: linear-gradient(140deg, #2F6FE0, #1A4FC4 55%, #C2600F);
  box-shadow: 0 8px 20px -6px rgba(61, 139, 255, 0.6);
  font-weight: 800;
}

#screen-account .account-page-hero p {
  color: var(--v-tx2);
  overflow-wrap: break-word;
}

#screen-account .account-page-hero .settings-plan-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(61, 139, 255, 0.22);
  font-weight: 650;
}

/* =====================================================================================================================
   Sign-in, sign-up, email code, two-step and "Secure your account" (#authGate)
   ===================================================================================================================== */
html body .auth-gate {
  background:
    radial-gradient(60% 40% at 15% 0%, rgba(61, 139, 255, 0.22), transparent 70%),
    radial-gradient(45% 35% at 100% 8%, rgba(255, 154, 47, 0.14), transparent 70%),
    var(--v-bg);
}

html body .auth-gate .signin {
  gap: 22px;
  font-family: var(--v-font);
}

html body .auth-gate .signin-eyebrow {
  color: var(--v-tx2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

html body .auth-gate .signin-title {
  color: var(--v-tx);
  font-size: clamp(30px, 8.8vw, 36px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

html body .auth-gate .signin-title b {
  color: transparent;
  background: linear-gradient(100deg, #7DB8FF 0%, #3D8BFF 45%, #FFB547 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 800;
}

html body .auth-gate .signin-subcopy {
  color: var(--v-tx2);
  font-size: 16px;
  line-height: 1.45;
}

/* Sign-up progress: one bar per step, lit up to the step you are on. */
html body .auth-gate .signin-steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 220px;
  margin: 2px 0 4px;
}

html body .auth-gate .signin-steps i {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

html body .auth-gate .signin-steps i.on {
  background: linear-gradient(90deg, #7DB8FF, #3D8BFF);
  box-shadow: 0 0 12px rgba(61, 139, 255, 0.55);
}

/* The price preview is a small car hero: tonight's bars, the cheapest hours lit and glowing. */
html body .auth-gate .signin-preview {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--v-r-card);
  padding: 16px 16px 12px;
  background: var(--v-hero-car);
  box-shadow: 0 18px 40px -22px rgba(61, 139, 255, 0.75);
}

html body .auth-gate .signin-preview-head {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

html body .auth-gate .signin-preview-head em {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 600;
}

html body .auth-gate .signin-live-dot {
  background: var(--v-mint);
  box-shadow: 0 0 10px rgba(59, 232, 166, 0.8);
}

html body .auth-gate .signin-bars i {
  background: rgba(255, 255, 255, 0.16);
}

html body .auth-gate .signin-bars i.on {
  background: linear-gradient(180deg, #FFFFFF, #9CCBFF);
  box-shadow: 0 0 14px rgba(160, 205, 255, 0.75);
}

html body .auth-gate .signin-preview-axis {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 600;
}

/* Log in / Create account: the car segmented control. */
html body .auth-gate .signin-tabs {
  border: 1px solid var(--v-line);
  border-radius: 999px;
  padding: 4px;
  background: var(--v-card);
}

html body .auth-gate .signin-tabs::before {
  border-radius: 999px;
  background: linear-gradient(160deg, #3D8BFF, #1A4FC4);
  box-shadow: 0 6px 18px -8px rgba(61, 139, 255, 0.9);
}

html body .auth-gate .signin-tabs button {
  border-radius: 999px;
  color: var(--v-tx2);
  font-size: 15px;
  font-weight: 650;
}

html body .auth-gate .signin-tabs button.active {
  color: #fff;
  font-weight: 700;
}

/* Fields: raised dark glass with a hairline, a blue ring on focus. */
html body .auth-gate .signin-field input,
html body .auth-gate .two-step-field input {
  min-height: 56px;
  border: 1px solid var(--v-line-strong);
  border-radius: var(--v-r-inner);
  color: var(--v-tx);
  background: var(--v-card2);
  font-size: 16px;
  font-weight: 500;
}

html body .auth-gate .signin-field input:focus,
html body .auth-gate .two-step-field input:focus {
  border-color: var(--v-car);
  box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.25);
}

html body .auth-gate .signin-field-label {
  color: var(--v-tx3);
  font-weight: 500;
}

html body .auth-gate .signin-field input:not(:placeholder-shown) + .signin-field-label,
html body .auth-gate .signin-field input:focus + .signin-field-label {
  color: var(--v-tx2);
}

html body .auth-gate .signin-field:focus-within .signin-field-icon,
html body .auth-gate .signin-reveal[aria-pressed="true"] {
  color: var(--v-car2);
}

html body .auth-gate .signin-field-icon {
  color: var(--v-tx3);
}

html body .auth-gate .signin-link {
  color: var(--v-car2);
  font-size: 15px;
  font-weight: 650;
}

/* Messages: a clear tinted card each, so an error always reads as "here's what to do". */
html body .auth-gate .signin-error,
html body .auth-gate .two-step-error {
  border: 1px solid rgba(255, 106, 92, 0.35);
  border-radius: var(--v-r-inner);
  padding: 12px 14px;
  color: #FFC9C2;
  background: rgba(255, 106, 92, 0.12);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.4;
}

html body .auth-gate .signin-message {
  border: 1px solid rgba(59, 232, 166, 0.3);
  border-radius: var(--v-r-inner);
  padding: 12px 14px;
  color: #B9F6DD;
  background: rgba(59, 232, 166, 0.1);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.4;
}

html body .auth-gate .signin-zip-status[data-tone="ok"] {
  color: var(--v-mint);
}

html body .auth-gate .signin-zip-status[data-tone="warn"] {
  color: var(--v-sun);
}

html body .auth-gate .signin-primary {
  min-height: 54px !important;
  font-size: 17px;
}

html body .auth-gate .signin-divider {
  color: var(--v-tx3);
  font-weight: 650;
}

html body .auth-gate .signin-alt-button {
  min-height: 48px;
  border: 1px solid var(--v-line-strong);
  border-radius: 999px;
  color: var(--v-tx);
  background: rgba(255, 255, 255, 0.06);
  font-size: 15px;
  font-weight: 650;
}

html body .auth-gate .signin-footer {
  color: var(--v-tx2);
  font-weight: 500;
}

/* Making an account keeps to the form: the price preview is for the log-in screen. */
html body .auth-gate .signin[data-mode="signup"] .signin-preview {
  display: none;
}

/* =====================================================================================================================
   Sheets: the vivid header (eyebrow, heavy title, round close), dark-glass fields and row links
   ===================================================================================================================== */
html body :is(.app-sheet, .setup-sheet, .tesla-auth-sheet, .command-sheet, .target-picker-sheet) .sheet-top .eyebrow {
  margin: 0 0 2px;
  color: var(--v-tx2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html body :is(.app-sheet, .setup-sheet, .tesla-auth-sheet, .command-sheet, .target-picker-sheet) .sheet-top h2 {
  color: var(--v-tx);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

html body :is(.app-sheet-overlay, .setup-overlay, .tesla-auth-overlay) .sheet-top .icon-button {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--v-line);
  border-radius: 50%;
  color: var(--v-tx);
  background: var(--v-raised);
}

html body :is(.app-sheet-overlay, .setup-overlay, .tesla-auth-overlay) .sheet-top .icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* Text fields inside sheets. */
html body :is(.app-sheet-overlay, .setup-overlay, .tesla-auth-overlay) :is(.field, .account-field) :is(input, select, textarea) {
  min-height: 50px;
  border: 1px solid var(--v-line-strong);
  border-radius: var(--v-r-inner);
  color: var(--v-tx);
  background: var(--v-card2);
  font-size: 16px;
  font-weight: 500;
}

html body :is(.app-sheet-overlay, .setup-overlay, .tesla-auth-overlay) :is(.field, .account-field) :is(input, select, textarea):focus {
  border-color: var(--v-car);
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.25);
}

html body :is(.app-sheet-overlay, .setup-overlay) :is(.field, .account-field) > span:first-child {
  color: var(--v-tx2);
  font-size: 13px;
  font-weight: 600;
}

/* Sheet footers: the primary takes the room, the secondary sits beside it. */
html body .app-sheet .sheet-actions {
  gap: 10px;
}

/* =====================================================================================================================
   Help & support (#supportDiagnosticsOverlay): how things are first, three actions, details behind a tap
   ===================================================================================================================== */
#supportDiagnosticsOverlay .support-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 14px;
  border: 1px solid rgba(59, 232, 166, 0.3);
  border-radius: var(--v-r-card);
  padding: 16px;
  background: radial-gradient(80% 90% at 100% 0%, rgba(59, 232, 166, 0.18), transparent 70%), var(--v-card2);
}

#supportDiagnosticsOverlay .support-status[data-tone="warn"] {
  border-color: rgba(255, 181, 71, 0.35);
  background: radial-gradient(80% 90% at 100% 0%, rgba(255, 181, 71, 0.18), transparent 70%), var(--v-card2);
}

#supportDiagnosticsOverlay .support-status-dot {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--v-mint);
  box-shadow: 0 0 12px rgba(59, 232, 166, 0.8);
}

#supportDiagnosticsOverlay .support-status-dot.warn {
  background: var(--v-sun);
  box-shadow: 0 0 12px rgba(255, 181, 71, 0.8);
}

#supportDiagnosticsOverlay .support-status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#supportDiagnosticsOverlay .support-status-text strong {
  color: var(--v-tx);
  font-size: 17px;
  font-weight: 750;
}

#supportDiagnosticsOverlay .support-status-text small {
  color: var(--v-tx2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

#supportDiagnosticsOverlay .support-action-list {
  display: block;
  overflow: hidden;
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  background: var(--v-card);
}

#supportDiagnosticsOverlay .support-action-list button:not(.hidden) {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 1px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
  color: var(--v-tx);
  background: transparent;
  box-shadow: none;
  text-align: left;
}

#supportDiagnosticsOverlay .support-action-list button:not(.hidden) ~ button:not(.hidden) {
  background-image: linear-gradient(var(--v-line), var(--v-line));
  background-repeat: no-repeat;
  background-position: 62px 0;
  background-size: calc(100% - 62px) 1px;
}

#supportDiagnosticsOverlay .support-action-list button::after {
  display: none;
}

#supportDiagnosticsOverlay .support-ico {
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 2;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--v-r-small);
}

#supportDiagnosticsOverlay .support-ico svg,
#supportDiagnosticsOverlay .support-chev,
#supportDiagnosticsOverlay .support-details summary svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#supportDiagnosticsOverlay .support-ico.car {
  color: var(--v-car2);
  background: rgba(61, 139, 255, 0.18);
}

#supportDiagnosticsOverlay .support-ico.mint {
  color: var(--v-mint);
  background: rgba(59, 232, 166, 0.15);
}

#supportDiagnosticsOverlay .support-ico.mint svg {
  fill: currentColor;
  stroke: none;
}

#supportDiagnosticsOverlay .support-ico.sun {
  color: var(--v-sun);
  background: rgba(255, 181, 71, 0.16);
}

#supportDiagnosticsOverlay .support-action-list button strong {
  grid-column: 2;
  grid-row: 1;
  font-size: 16px;
  font-weight: 600;
}

#supportDiagnosticsOverlay .support-action-list button span {
  grid-column: 2;
  grid-row: 2;
  overflow-wrap: break-word;
  word-break: normal;
  color: var(--v-tx2);
  font-size: 13px;
  font-weight: 500;
}

#supportDiagnosticsOverlay .support-chev {
  grid-column: 3;
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  color: var(--v-tx3);
  stroke-width: 2.2;
}

#supportDiagnosticsOverlay .support-details {
  margin-top: 14px;
}

#supportDiagnosticsOverlay .support-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 4px;
  color: var(--v-tx2);
  font-size: 15px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

#supportDiagnosticsOverlay .support-details summary::-webkit-details-marker {
  display: none;
}

#supportDiagnosticsOverlay .support-details[open] summary svg {
  transform: rotate(180deg);
}

#supportDiagnosticsOverlay .diagnostic-status-grid > div {
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-inner);
  background: var(--v-card2);
}

/* =====================================================================================================================
   First run (#setupOverlay) and Tesla connect (#teslaAuthOverlay): progress, one hero, one action
   ===================================================================================================================== */
#setupOverlay .setup-sheet.onboarding-screen {
  background:
    radial-gradient(60% 34% at 10% 0%, rgba(61, 139, 255, 0.2), transparent 70%),
    radial-gradient(45% 30% at 100% 6%, rgba(255, 154, 47, 0.12), transparent 70%),
    var(--v-bg);
}

#setupOverlay .setup-top h2 {
  color: var(--v-tx);
  font-size: clamp(28px, 8.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

#setupOverlay .setup-top .eyebrow {
  color: var(--v-tx2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

#setupOverlay .setup-step-pill {
  border: 1px solid var(--v-line);
  color: var(--v-tx);
  background: var(--v-raised);
  font-weight: 650;
  white-space: nowrap;
}

#setupOverlay .setup-progress span {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

#setupOverlay .setup-progress span.active,
#setupOverlay .setup-progress span.complete {
  background: linear-gradient(90deg, #7DB8FF, #3D8BFF);
  box-shadow: 0 0 12px rgba(61, 139, 255, 0.55);
}

/* The step's hero: the car step is lit blue, the utility step mint, a home step amber. */
#setupOverlay .setup-step-card {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: var(--v-r-hero);
  color: #fff;
  background: var(--v-hero-car) !important;
  box-shadow: 0 22px 44px -26px rgba(61, 139, 255, 0.8) !important;
}

#setupOverlay .setup-step-card.utility {
  background: var(--v-hero-mint) !important;
  box-shadow: 0 22px 44px -26px rgba(59, 232, 166, 0.7) !important;
}

#setupOverlay[data-choosing="true"] .setup-step-card {
  display: none;
}

#setupOverlay .setup-hero,
#setupOverlay .onboarding-symbol,
#setupOverlay .onboarding-symbol.bolt,
#setupOverlay .onboarding-symbol.done {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

#setupOverlay .setup-hero svg {
  stroke-width: 2;
}

#setupOverlay .setup-step-card .eyebrow {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  letter-spacing: 0.12em;
}

#setupOverlay .setup-hero-copy h3 {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

#setupOverlay .setup-step-card .setup-copy {
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
}

#setupOverlay .setup-benefits li {
  color: #fff;
  font-weight: 600;
}

#setupOverlay .setup-benefits li::before {
  border-color: transparent;
  color: var(--v-ink-mint);
  background-color: var(--v-mint);
}

/* "What do you have?": three big choices, each in its area's colour. */
#setupOverlay .setup-choice {
  min-height: 76px;
  border: 1px solid var(--v-line) !important;
  border-radius: var(--v-r-card);
  padding: 16px;
  background: var(--v-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#setupOverlay .setup-choice.active,
#setupOverlay .setup-choice:active {
  border-color: rgba(61, 139, 255, 0.6) !important;
  background: var(--v-card2);
}

#setupOverlay .setup-choice strong {
  color: var(--v-tx);
  font-size: 17px;
  font-weight: 700;
}

#setupOverlay .setup-choice small {
  color: var(--v-tx2);
  font-size: 14px;
  font-weight: 500;
}

#setupOverlay .setup-choice .device-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--v-car2);
  background: rgba(61, 139, 255, 0.18);
}

#setupOverlay .setup-choice .device-icon.tone-sun {
  color: var(--v-sun);
  background: rgba(255, 181, 71, 0.16);
}

#setupOverlay .setup-choice .device-icon.tone-both {
  color: #fff;
  background: var(--v-garage-grad);
}

#setupOverlay .setup-choice .device-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

#setupOverlay .setup-skip {
  color: var(--v-car2);
  font-weight: 650;
}

/* Tesla connect: a lock on a lit card, what Tesla will ask, and one button. */
#teslaAuthOverlay .tesla-logo-mark {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(160deg, #E8323C, #9E1B23);
  font-weight: 800;
}

#teslaAuthOverlay .tesla-auth-top h2 {
  color: var(--v-tx);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

#teslaAuthOverlay .tesla-auth-top .eyebrow {
  color: var(--v-tx2);
  font-weight: 700;
  letter-spacing: 0.12em;
}

#teslaAuthOverlay #teslaAuthCopy {
  color: var(--v-tx2);
  font-size: 15px;
}

#teslaAuthOverlay .tesla-auth-browser {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--v-r-card);
  background: var(--v-hero-car);
}

#teslaAuthOverlay .tesla-lock {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

#teslaAuthOverlay .browser-body strong {
  color: #fff;
  font-size: 17px;
  font-weight: 750;
}

#teslaAuthOverlay .browser-body small {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 500;
}

/* App lock: the logo on a soft car-to-home glow, one line and Unlock. */
#appLockScreen {
  background:
    radial-gradient(50% 32% at 50% 40%, rgba(61, 139, 255, 0.22), transparent 70%),
    radial-gradient(40% 26% at 70% 52%, rgba(255, 154, 47, 0.12), transparent 70%),
    var(--v-bg);
}

#appLockScreen h2 {
  color: var(--v-tx);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

#appLockScreen .app-lock-copy {
  max-width: 28ch;
  margin: -4px auto 8px;
  color: var(--v-tx2);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

#appLockScreen #appUnlockButton {
  min-width: 200px;
}

/* =====================================================================================================================
   Plans & billing: the choice made easy. One line on top says how billing works; "Your plan" is a mint chip, "Best
   value" the gold badge; the suggested plan keeps its blue ring and the vivid primary.
   ===================================================================================================================== */
#billingSettingsOverlay .plan-picker-lead {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin: 0 0 4px;
  padding: 0 2px;
  color: var(--v-tx2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

#billingSettingsOverlay .plan-picker-lead span:first-child {
  color: var(--v-mint);
}

#billingSettingsOverlay .plan-option-tag {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--v-ink-mint);
  background: var(--v-mint);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

#billingSettingsOverlay .plan-option-tag.plan-option-tag-best {
  color: #0A0E15;
  background: #FFC86A linear-gradient(90deg, #FFE29A, #FFB547);
  box-shadow: 0 4px 14px -6px rgba(255, 181, 71, 0.8);
}

#billingSettingsOverlay #planOptionOne:not(.current) {
  border-color: rgba(255, 196, 110, 0.45);
}

#billingSettingsOverlay .plan-option.current {
  border-color: rgba(59, 232, 166, 0.65);
  box-shadow: 0 0 0 1px rgba(59, 232, 166, 0.25);
}

#billingSettingsOverlay .plan-option-for {
  color: var(--v-tx2);
  font-size: 15px;
  font-weight: 550;
}

#billingSettingsOverlay .plan-option-free {
  border: 1px dashed var(--v-line-strong);
  border-radius: var(--v-r-card);
  background: transparent;
}

#billingSettingsOverlay .plan-picker-terms {
  color: var(--v-tx3);
}

#billingSettingsOverlay .billing-summary-card {
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  background: var(--v-card);
}

/* =====================================================================================================================
   Shared access: the "viewing someone's account" banner (storm violet, so it never reads as your own account) and
   the sheet's rows
   ===================================================================================================================== */
html body .shared-account-banner:not(.hidden) {
  border: 1px solid rgba(166, 148, 255, 0.35);
  border-radius: var(--v-r-inner);
  padding: 10px 10px 10px 14px;
  background: radial-gradient(70% 120% at 100% 0%, rgba(166, 148, 255, 0.28), transparent 70%), #17142E;
  box-shadow: 0 10px 28px -16px rgba(120, 100, 255, 0.8);
}

html body .shared-account-banner strong {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

html body .shared-account-banner small {
  color: #D6CEFF;
  font-size: 13px;
  font-weight: 600;
}

html body .shared-account-banner button {
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  font-weight: 700;
}


#sharedAccessOverlay .setting-head {
  color: var(--v-tx2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#sharedAccessOverlay .shared-access-row strong {
  color: var(--v-tx);
  font-weight: 650;
}

#sharedAccessOverlay .shared-access-row :is(strong, small) {
  overflow-wrap: normal;
  word-break: normal;
}

#sharedAccessOverlay .shared-access-row small,
#sharedAccessOverlay .shared-access-note {
  color: var(--v-tx2);
}

#sharedAccessOverlay .shared-access-btn:not(.primary) {
  border: 1px solid var(--v-line-strong);
  color: var(--v-tx);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 650;
}

#sharedAccessOverlay .shared-access-note.error {
  border: 1px solid rgba(255, 106, 92, 0.35);
  border-radius: var(--v-r-inner);
  padding: 10px 12px;
  color: #FFC9C2;
  background: rgba(255, 106, 92, 0.12);
}

#sharedAccessOverlay .shared-access-role {
  min-height: 44px;
  border: 1px solid var(--v-line-strong);
  border-radius: 999px;
  color: var(--v-tx);
  background: var(--v-card2);
}

/* First run: the step pill and close button take the first line at every width, so the 800-weight title always has
   the full width (beside them it broke after "Connect your" at 390). */
#setupOverlay .setup-top.onboarding-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "step close"
    "text text";
  align-items: center;
  gap: 12px;
}

#setupOverlay .setup-top.onboarding-top > div:first-child {
  grid-area: text;
  min-width: 0;
}

#setupOverlay .setup-top.onboarding-top > .setup-step-pill {
  grid-area: step;
  justify-self: start;
}

#setupOverlay .setup-top.onboarding-top > #setupCloseButton {
  grid-area: close;
}

/* A Powerwall-only home's step is lit amber, the home's colour, not the car's blue. */
#setupOverlay[data-has="home"][data-setup-step="0"] .setup-step-card {
  background: var(--v-hero-sun) !important;
  box-shadow: 0 22px 44px -26px rgba(255, 154, 47, 0.7) !important;
}

/* Me: the first-visit "Ask Vera" label would float over the rows as they scroll; the round Vera button is enough here,
   as on Plan and Savings. */
body:has(#screen-settings.active) .rev-button.intro .rev-button-label {
  opacity: 0;
}

/* Failed loads: a coral note with a Try again button under it, never a bare line of grey text. */
#walletOverlay .wallet-empty[role="alert"] {
  border: 1px solid rgba(255, 106, 92, 0.35);
  border-radius: var(--v-r-inner);
  padding: 12px 14px;
  color: #FFC9C2;
  background: rgba(255, 106, 92, 0.12);
  text-align: left;
}

#walletOverlay .wallet-retry {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 1px solid var(--v-line-strong);
  border-radius: 999px;
  color: var(--v-tx);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 650;
}

#sharedAccessOverlay .shared-access-failed {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

#sharedAccessOverlay .shared-access-failed .shared-access-btn {
  width: 100%;
  min-height: 48px;
}

/* Help: the first thing to check comes with the button that fixes it. */
#supportDiagnosticsOverlay .support-status-action {
  justify-self: start;
  align-self: flex-start;
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid rgba(255, 181, 71, 0.45);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--v-tx);
  background: rgba(255, 181, 71, 0.14);
  font-size: 15px;
  font-weight: 700;
}

/* Under 360px the plan badge would squeeze the name onto two lines; the plan line under the name already says it. */
/* On the narrowest phones the plan line already names a paid plan; Free's short badge stays, since its line doesn't. */
@media (max-width: 359px) {
  #screen-settings .me-plan-badge:not([data-plan=""]) {
    display: none;
  }
}

/* A group whose rows are all hidden (Preferences for a home without a car) goes too, label and all. */
#screen-settings .settings-landing-group:not(:has(.settings-route-row:not(.hidden))) {
  display: none;
}

/* Alerts: the same sheet header as every other sheet (heavy title, round 44px close), and calm, roomy rows. */
#alertsOverlay .alerts-sheet-head {
  align-items: flex-start;
  padding: 22px 20px 14px 24px;
  border-bottom: 1px solid var(--v-line);
}

#alertsOverlay .alerts-sheet-head h2 {
  color: var(--v-tx);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

#alertsOverlay .alerts-sheet-head p {
  margin-top: 4px;
  color: var(--v-tx2);
  font-size: 14px;
  line-height: 1.4;
}

#alertsOverlay .alerts-sheet-head .icon-button {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--v-line);
  border-radius: 50%;
  color: var(--v-tx);
  background: var(--v-raised);
}

#alertsOverlay .alerts-off {
  border: 1px solid rgba(255, 181, 71, 0.3);
  border-radius: var(--v-r-card);
  padding: 18px;
  background: radial-gradient(80% 90% at 100% 0%, rgba(255, 181, 71, 0.16), transparent 70%), var(--v-card2);
}

/* The plan an upgrade asked for says what it would do tonight. */
#billingSettingsOverlay .plan-option-estimate {
  margin: 8px 0 0;
  color: #3BE8A6;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

#billingSettingsOverlay .plan-option-estimate.hidden {
  display: none;
}

/* ---------- Electricity rates sheet: two calm steps, the utility and then its rate plan ---------- */
#utilitySettingsOverlay .utility-city-field,
#utilitySettingsOverlay .utility-sheet[data-name-search="false"] .utility-name-field,
#utilitySettingsOverlay .utility-sheet[data-name-search="true"] .utility-name-link,
#utilitySettingsOverlay .utility-sheet[data-utility-step="provider"] .utility-rate-hero,
#utilitySettingsOverlay .utility-sheet[data-utility-step="provider"] .utility-chosen,
#utilitySettingsOverlay .utility-sheet[data-utility-step="provider"] .tariff-field,
#utilitySettingsOverlay .utility-sheet[data-utility-step="provider"] .utility-compat,
#utilitySettingsOverlay .utility-sheet[data-utility-step="provider"] .utility-results-note,
#utilitySettingsOverlay .utility-sheet[data-utility-step="results"] .provider-candidate-list,
#utilitySettingsOverlay .utility-sheet[data-utility-step="results"] .utility-name-link {
  display: none;
}

#utilitySettingsOverlay .utility-provider-stage {
  gap: 14px;
}

#utilitySettingsOverlay .utility-step-lead {
  margin: 0;
  color: var(--v-tx2);
  font-size: 15px;
  line-height: 1.4;
}

#utilitySettingsOverlay .utility-zip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

#utilitySettingsOverlay .utility-zip-row .setting-line {
  margin: 0;
}

#utilitySettingsOverlay .utility-find-button {
  min-width: 76px;
  min-height: 48px;
  padding: 0 18px;
}

#utilitySettingsOverlay .utility-list-head {
  margin: 10px 0 0;
  color: var(--v-tx2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

#utilitySettingsOverlay .utility-results-stage {
  gap: 12px;
}

#utilitySettingsOverlay .utility-results-stage .provider-candidate-list {
  margin: 0;
}

#utilitySettingsOverlay .provider-candidate-list button {
  min-height: 64px;
  padding: 12px 16px;
  gap: 12px;
  border: 1px solid transparent;
}

#utilitySettingsOverlay .provider-candidate-list button.active {
  border-color: rgba(61, 139, 255, 0.55);
}

#utilitySettingsOverlay .provider-candidate-list strong {
  font-size: 16px;
  font-weight: 650;
}

/* The pick: an empty ring, filled with a tick for the chosen utility. */
#utilitySettingsOverlay .utility-pick {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--v-slate);
  border-radius: 50%;
}

#utilitySettingsOverlay .provider-candidate-list button.active .utility-pick {
  border-color: transparent;
  background: var(--v-car);
}

#utilitySettingsOverlay .provider-candidate-list button.active .utility-pick::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

#utilitySettingsOverlay .text-link {
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--v-car2);
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

#utilitySettingsOverlay .utility-chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  border-radius: 16px;
  background: var(--v-card2);
}

#utilitySettingsOverlay .utility-chosen > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#utilitySettingsOverlay .utility-chosen strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

#utilitySettingsOverlay .utility-chosen .text-link {
  flex: none;
  padding: 0 10px;
}

/* The note under the plan is plain text on the card, never a highlighted box. */
#utilitySettingsOverlay .utility-compat {
  margin-top: 0;
  border: 0;
  background: var(--v-card2);
}

#utilitySettingsOverlay .utility-compat-note {
  padding: 0;
  color: var(--v-tx2);
  background: transparent;
  font-size: 15px;
  line-height: 1.45;
}

#utilitySettingsOverlay .utility-sheet > .sheet-actions {
  margin-top: 20px;
}

#utilitySettingsOverlay .utility-sheet > .sheet-actions button:disabled {
  opacity: 0.45;
}

#utilitySettingsOverlay .utility-zip-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

#utilitySettingsOverlay .utility-results-stage .utility-rate-hero {
  margin: 0;
  background: var(--v-card2) !important;
}

/* Waiting for Tesla: a slow ring on the lit card while Tesla's page is open. */
#teslaAuthOverlay .tesla-auth-spinner {
  display: none;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tesla-auth-spin 1s linear infinite;
}

#teslaAuthOverlay[data-waiting="true"] .tesla-auth-spinner {
  display: block;
}

#teslaAuthOverlay[data-waiting="true"] .tesla-lock {
  display: none;
}

@keyframes tesla-auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  #teslaAuthOverlay .tesla-auth-spinner {
    animation-duration: 3s;
  }
}

/* Secure your account (optional): Not now sits at the top, beside the logo, visible without scrolling. */
.signin-hero-top {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-gate .signin-hero-top .signin-logo {
  margin-bottom: 0;
}

.signin-hero-top .signin-link {
  flex: none;
  min-height: 44px;
  padding: 0 4px 0 12px;
}

/* The sell moment: one plain line on what the plan does, above "Monthly. Cancel anytime." */
#billingSettingsOverlay .plan-picker-pitch {
  margin: 0;
  padding: 0 2px;
  color: var(--v-tx);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

#billingSettingsOverlay .plan-picker-pitch.hidden,
#billingSettingsOverlay .plan-attention.hidden {
  display: none;
}

/* A payment that didn't go through: first on the sheet, amber, with Update card. */
#billingSettingsOverlay .plan-attention {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(255, 181, 71, 0.45);
  border-radius: var(--v-r-card, 20px);
  background: rgba(255, 181, 71, 0.1);
}

#billingSettingsOverlay .plan-attention strong {
  color: var(--v-sun);
  font-size: 16px;
}

#billingSettingsOverlay .plan-attention span {
  color: var(--v-tx2);
  font-size: 14px;
  line-height: 1.4;
}

#billingSettingsOverlay .plan-attention button {
  justify-self: start;
  margin-top: 6px;
}

#utilitySettingsOverlay .utility-sheet[data-utility-step="provider"] .utility-results-stage {
  margin-top: 10px;
}

/* Setup's bars follow the step count, however many steps the count has. */
#setupOverlay .setup-progress {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

/* The utility sheet's Next / Save stays in reach on short phones instead of sitting below a long list. */
#utilitySettingsOverlay .app-sheet > .sheet-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 16px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(14, 20, 31, 0), var(--v-card, #0E141F) 14px);
}

/* On a short phone first-run setup keeps to its one job: the hero's ticks give way so Connect stays on screen. */
@media (max-height: 640px) {
  #setupOverlay .setup-benefits {
    display: none;
  }
}

/* =====================================================================================================================
   Me, redesigned: the header card is information with its own plan buttons (not one big button), "Needs attention"
   when something does, grouped rows that each open a sheet over Me, and the way out at the bottom.
   ===================================================================================================================== */
#screen-settings .me-header {
  gap: 12px;
  margin-bottom: 22px;
  cursor: default;
}
#screen-settings .me-header:hover,
#screen-settings .me-header:active,
#screen-settings .me-header:focus-visible {
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(255, 154, 47, 0.16), transparent 70%),
    linear-gradient(135deg, rgba(61, 139, 255, 0.24), rgba(255, 154, 47, 0.1) 70%, rgba(59, 232, 166, 0.08)),
    var(--v-card) !important;
}
#screen-settings .me-header .me-profile-top { align-items: flex-start; }
#screen-settings .me-header .me-profile-text { padding-top: 4px; }

/* The plan's own badge: ONE gold, DRIVE blue, HOME amber, FREE a quiet outline. */
#screen-settings .me-plan-badge[data-plan=""] {
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 10px;
  color: var(--v-tx);
  background: rgba(255, 255, 255, 0.08);
}

#screen-settings .me-plan-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
#screen-settings .me-plan-line .me-plan-badge { margin-top: 0; align-self: center; }
#screen-settings .me-plan-line .settings-plan-chip {
  display: block;
  flex: 1 1 180px;
  min-width: 0;
  color: var(--v-tx) !important;
  font-size: 15px;
  font-weight: 600;
}
#screen-settings .me-plan-line .settings-plan-chip[data-tone="neutral"] { color: var(--v-tx2) !important; }
#screen-settings .me-plan-line .settings-plan-chip[data-tone="warn"] { color: var(--v-sun) !important; }

#screen-settings .me-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#screen-settings .me-plan-actions.hidden { display: none; }
#screen-settings .me-plan-actions .v-btn {
  min-height: 48px;
  font-size: 15px;
}
#screen-settings .me-plan-actions .v-btn.primary { flex: 1 1 auto; padding: 0 16px; }
#screen-settings .me-plan-actions .v-btn.ghost {
  flex: 1 0 auto;
  padding: 0 16px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(0, 8, 30, 0.28);
}
#screen-settings .me-plan-actions[data-count="1"] .v-btn { flex: 1 1 100%; }

/* Needs attention: what to fix, each with its button. */
#screen-settings .me-attention { margin: 0 0 24px; }
#screen-settings .me-attention.hidden { display: none; }
#screen-settings .me-attention-list {
  border: 1px solid rgba(255, 181, 71, 0.32);
  border-radius: var(--v-r-card);
  background: linear-gradient(160deg, rgba(255, 181, 71, 0.1), rgba(255, 181, 71, 0.03)), var(--v-card);
}
#screen-settings .me-attention-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: start;
  padding: 14px 16px;
}
#screen-settings .me-attention-item + .me-attention-item { border-top: 1px solid var(--v-line); }
#screen-settings .me-attention-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--v-sun);
  box-shadow: 0 0 10px rgba(255, 181, 71, 0.7);
}
#screen-settings .me-attention-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#screen-settings .me-attention-text strong { color: var(--v-tx); font-size: 16px; font-weight: 650; line-height: 1.3; }
#screen-settings .me-attention-text small { color: var(--v-tx2); font-size: 14px; line-height: 1.4; }
#screen-settings .me-attention-fix {
  grid-column: 2;
  justify-self: start;
  min-height: 48px;
  margin-top: 6px;
}
#screen-settings .me-attention-fix.ghost {
  min-height: 44px;
  border-color: var(--v-line-strong);
  background: var(--v-card2);
}

/* A row's value can warn (a car that needs reconnecting), and a row can carry a plan badge after its label. */
#screen-settings .settings-route-row small[data-tone="warn"] { color: var(--v-sun); }
#screen-settings .settings-route-row strong .me-row-badge:empty { display: none; }
#screen-settings .settings-route-row strong .me-row-badge {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: 1px;
}
#screen-settings .settings-route-row > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#screen-settings .settings-route-row > span:nth-child(2) strong { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; }
#screen-settings .settings-route-row > span:nth-child(2) strong { column-gap: 8px; }
#screen-settings .settings-route-row strong .me-row-badge { margin-left: 0; }
/* An information row (web Alerts) has no chevron. */
#screen-settings .settings-route-row.me-info-row { grid-template-columns: 36px minmax(0, 1fr); cursor: default; }

/* The way out: Sign out, who's signed in, Delete account in red, then the version. */
#screen-settings .me-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px;
  text-align: center;
}
#screen-settings .me-signout {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--v-line-strong);
  border-radius: var(--v-r-card);
  color: var(--v-tx);
  background: var(--v-card);
  font-size: 16px;
  font-weight: 650;
}
#screen-settings .me-signout[data-confirm="true"] {
  border-color: rgba(255, 106, 92, 0.55);
  color: #FFB4AB;
  background: rgba(255, 106, 92, 0.1);
}
#screen-settings .me-signed-in {
  margin: 2px 0 10px;
  color: var(--v-tx3);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#screen-settings .me-delete-account {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #FF8A7E;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
#screen-settings .me-delete-account:focus-visible { outline: 2px solid #FF8A7E; outline-offset: 2px; }
#screen-settings :is(.me-delete-account, .me-signout, .me-signed-in).hidden { display: none; }
#screen-settings .me-version {
  margin: 6px 0 0;
  color: var(--v-tx3);
  font-size: 12px;
  line-height: 1.4;
}

/* =====================================================================================================================
   The account sheet, one part at a time (data-mode): Personal info, Vehicles, Data sharing, Your data, Delete account.
   ===================================================================================================================== */
#accountSettingsOverlay .me-sheet-intro {
  margin: 0 0 10px;
  color: var(--v-tx2);
  font-size: 14px;
  line-height: 1.4;
}
#accountSettingsOverlay .settings-subsection { border-top: 0; }
#accountSettingsOverlay[data-mode="delete"] .delete-account-row { display: none; }

/* Remove Tesla: last, apart, and in red, with what it does. */
#accountSettingsOverlay .me-danger-zone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--v-line);
}
#accountSettingsOverlay .me-danger-zone.hidden { display: none; }
html body #accountSettingsOverlay .tesla-remove-button {
  min-height: 44px;
  padding: 0;
  color: #FF8A7E !important;
  font-weight: 650;
}
#accountSettingsOverlay .me-danger-zone small {
  color: var(--v-tx3);
  font-size: 13px;
  line-height: 1.4;
}

/* Your data: each request with its own button and what happens next. */
#accountSettingsOverlay .me-data-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
#accountSettingsOverlay .me-data-row > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#accountSettingsOverlay .me-data-row small { white-space: normal; }
#accountSettingsOverlay .me-data-row .secondary-action { min-width: 96px; }
#accountSettingsOverlay .me-erase-confirm {
  margin: 4px 0 8px;
  padding: 14px;
  border: 1px solid rgba(255, 106, 92, 0.35);
  border-radius: var(--v-r-inner);
  background: rgba(255, 106, 92, 0.07);
}
#accountSettingsOverlay .me-erase-confirm.hidden { display: none; }
#accountSettingsOverlay .me-erase-confirm p {
  margin: 0 0 10px;
  color: var(--v-tx);
  font-size: 14px;
  line-height: 1.45;
}
#accountSettingsOverlay .me-data-note {
  margin: 8px 0 0;
  color: var(--v-sun);
  font-size: 14px;
  line-height: 1.4;
}
#accountSettingsOverlay .me-data-note.hidden { display: none; }
#accountSettingsOverlay .delete-account { margin-top: 18px; }

/* =====================================================================================================================
   Autopilot & goal (#meChargingOverlay)
   ===================================================================================================================== */
#meChargingOverlay .me-charging-sheet > .sheet-top { margin-bottom: 16px; }
#meChargingOverlay .me-charging-sheet > * + .me-charging-block,
#meChargingOverlay .me-charging-sheet > .me-charging-more { margin-top: 12px; }
#meChargingOverlay .me-charging-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  background: var(--v-card);
}
#meChargingOverlay .me-charging-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
#meChargingOverlay .settings-route-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--v-r-small);
  color: var(--v-mint);
  background: rgba(59, 232, 166, 0.15);
}
#meChargingOverlay .settings-route-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#meChargingOverlay .me-charging-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#meChargingOverlay .me-charging-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--v-tx);
  font-size: 17px;
  font-weight: 700;
}
#meChargingOverlay .me-charging-copy small { color: var(--v-tx2); font-size: 14px; line-height: 1.4; }
#meChargingOverlay .autopilot-switch.hidden { display: none; }
#meChargingOverlay .autopilot-switch input {
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: #3A4458;
}
#meChargingOverlay .autopilot-switch input::after { top: 2px; left: 2px; width: 27px; height: 27px; background: #fff; }
#meChargingOverlay .autopilot-switch input:checked { background: var(--v-mint2); }
#meChargingOverlay .me-goal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
#meChargingOverlay .me-charging-label { color: var(--v-tx); font-size: 16px; font-weight: 650; }
#meChargingOverlay .me-goal-value {
  color: var(--v-tx);
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
#meChargingOverlay .me-goal-range { width: 100%; }
#meChargingOverlay .me-goal-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -6px;
  color: var(--v-tx3);
  font-size: 12px;
}
#meChargingOverlay .me-goal-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--v-line);
}
#meChargingOverlay .me-goal-ready select {
  min-height: 44px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--v-line-strong);
  border-radius: var(--v-r-small);
  color: var(--v-tx);
  background: var(--v-card2);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
}
#meChargingOverlay .me-charging-more {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border: 1px solid var(--v-line);
  border-radius: var(--v-r-card);
  color: var(--v-tx);
  background: var(--v-card);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#meChargingOverlay .me-charging-more span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#meChargingOverlay .me-charging-more strong { font-size: 16px; font-weight: 650; }
#meChargingOverlay .me-charging-more small { color: var(--v-tx2); font-size: 13px; line-height: 1.35; }
#meChargingOverlay .me-charging-more svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--v-tx3);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Line wraps: short copy breaks evenly, so a last word never sits on its own line. */
html body .auth-gate .signin-legal,
#revOverlay .rev-welcome p,
#billingSettingsOverlay .plan-option-benefits span,
#billingSettingsOverlay .plan-option-for {
  text-wrap: pretty;
}
.legal-disclaimer summary,
html body .auth-gate .signin-subcopy,
.rev-note,
.activity-sheet-head h2,
#screen-homeenergy .energy-page-empty .v-ttl,
#screen-homeenergy .home-plan-notice h3 {
  text-wrap: balance;
}

/* Data sharing and Your data have no Save bar: the last card keeps clear of the sheet's bottom edge. */
html body #accountSettingsOverlay .app-sheet:has(.account-settings-footer.hidden) {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* Choose your cars: the same blue button as every other sheet. */
html body #teslaCarsOverlay .tesla-cars-save {
  border-radius: 999px;
  color: #fff;
  background: #2563E0 var(--vme-primary);
  box-shadow: var(--vme-primary-glow);
  font-size: 16px;
  font-weight: 700;
}

/* Charge limit: the number sits beside its label, and the notes stand clear of Done. */
#chargeLimitOverlay .charge-limit-number-line {
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
}
#chargeLimitOverlay .charge-limit-number-line :is(strong, small) { display: block; }
#chargeLimitOverlay .charge-limit-number-line small { margin-top: 2px; color: var(--v-tx2); font-size: 13px; font-weight: 500; }
#chargeLimitOverlay .charge-limit-number-line input { text-align: center; }
#chargeLimitOverlay .panel-note { margin: 12px 0 0; font-size: 14px; line-height: 1.45; text-wrap: pretty; }
#chargeLimitOverlay .panel-note.compact { margin-top: 6px; color: var(--v-tx2); font-size: 13px; font-weight: 500; }
#chargeLimitOverlay .sheet-actions { margin-top: 18px; }

/* Account sheets use the same green switch as Alerts and Autopilot. */
html body #accountSettingsOverlay .settings-row input[type="checkbox"]:checked { background: var(--v-mint2); }
html body #accountSettingsOverlay .settings-row input[type="checkbox"]::after,
html body #accountSettingsOverlay .settings-row input[type="checkbox"]:checked::after { background: #fff; }

/* Save and Cancel never touch. */
html body #accountSettingsOverlay .account-settings-footer { gap: 12px; }
html body #accountSettingsOverlay .account-settings-footer button { margin: 0; min-width: 0; }

/* Help: the status card stands clear of the title. */
#supportDiagnosticsOverlay .support-status { margin-top: 14px; }

/* The select's chevron keeps its place inside the box. */
#meChargingOverlay .pv-select { position: relative; }
#meChargingOverlay .pv-select select {
  padding-right: 36px;
  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 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

@media (max-width: 360px) {
  /* Your data: the copy takes the full width, its button under it, instead of a ten-line column. */
  #accountSettingsOverlay .me-data-row { grid-template-columns: minmax(0, 1fr); }
  #accountSettingsOverlay .me-data-row .secondary-action { justify-self: start; }

  /* Sign in with Tesla keeps to one line, over Cancel. */
  #teslaAuthOverlay .tesla-auth-actions { flex-direction: column-reverse; align-items: stretch; }
  html body #teslaAuthOverlay .tesla-auth-actions button { width: 100%; max-width: none; }
  #teslaAuthOverlay #teslaAuthTitle { font-size: 22px; white-space: nowrap; }

  /* The preview's caption lines up with "Tonight" when it drops to its own line. */
  html body .auth-gate .signin-preview-head em { margin-left: 0; text-align: left; }
}

@media (max-width: 340px) {
  :is(#chargeLimitOverlay, #teslaCarsOverlay) .sheet-top h2 { font-size: 20px; }
  html body .auth-gate .signin-alt-button { gap: 8px; padding-inline: 10px; font-size: 14.5px; letter-spacing: -0.005em; }
}

/* Offline: the notice sat over a sheet's buttons and Vera's message box. While a sheet is open it steps aside; it's
   back when the sheet closes, and sheets say for themselves when something couldn't be sent. */
body:has(:is(.app-sheet-overlay, .schedule-editor-overlay, .tesla-auth-overlay):not(.hidden)) #offlineBanner { visibility: hidden; }

/* Anything not told otherwise: short copy never leaves one word alone on its last line. */
:where(p, small, .v-lbl) { text-wrap: pretty; }
