/* Calm redesign: owned by the Me screen agent (#screen-settings). Loaded after styles-calm.css.
   Covers the Me tab, the Account page under it, the sheets opened from Me (Profile & home, Plans & billing, Utility
   rates, Choose your cars, Shared access, Tesla sign-in), the setup journey and the sign-in gate. Rules are scoped to
   those screens and overlays so they do not reach Today, Plan or Savings. */

/* =====================================================================================================================
   Me tab and Account page
   ===================================================================================================================== */

/* Profile card: one flat surface, a soft round initial, name, email and a quiet plan line. */
#screen-settings .settings-profile-hero {
  grid-template-columns: 52px minmax(0, 1fr) 16px;
  gap: 16px;
  min-height: 92px;
  margin: 0 0 32px;
  border: 0 !important;
  border-radius: var(--calm-radius);
  padding: 18px 18px 18px 20px;
  background: var(--calm-surface) !important;
  box-shadow: none !important;
}

#screen-settings .settings-profile-hero:hover,
#screen-settings .settings-profile-hero:focus-visible {
  background: #161D2A !important;
}

#screen-settings .settings-profile-hero:active {
  transform: none;
  background: #161D2A !important;
}

#screen-settings .settings-profile-hero .settings-account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
  font-size: 20px;
  font-weight: 500;
}

#screen-settings .settings-profile-hero > span:nth-child(2) {
  gap: 3px;
}

#screen-settings .settings-profile-hero strong {
  color: var(--calm-text);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

#screen-settings .settings-profile-hero small {
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

/* Plan line: a small flat pill, accent when a plan is active, gray on Free. */
#screen-settings .settings-plan-chip,
#screen-account .settings-plan-chip {
  margin-top: 6px;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--calm-muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
}

#screen-settings .settings-plan-chip[data-tone="ok"],
#screen-account .settings-plan-chip[data-tone="ok"] {
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
}

/* Group labels: 12px uppercase, muted (faint is under 4.5:1 at this size), letter-spaced. */
#screen-settings .settings-landing-group,
#screen-account > .settings-landing-group {
  margin: 0 0 28px;
}

#screen-settings .settings-group-label,
#screen-account .settings-group-label {
  margin: 0 0 10px;
  padding: 0 4px;
  color: var(--calm-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Each group is one surface with hairline rows. */
#screen-settings .settings-landing-list,
#screen-account .settings-landing-list {
  overflow: hidden;
  border: 0 !important;
  border-radius: var(--calm-radius);
  padding: 0;
  background: var(--calm-surface);
  box-shadow: none !important;
}

#screen-settings .settings-route-row,
#screen-account .settings-route-row {
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  gap: 16px;
  min-height: 60px;
  border: 0;
  padding: 12px 18px 12px 20px;
  color: var(--calm-text);
  background: transparent;
}

#screen-settings .settings-route-row + .settings-route-row,
#screen-account .settings-route-row + .settings-route-row {
  border-top: 1px solid var(--calm-line);
}

/* No divider above the first visible row when hidden rows (Alerts, fingerprint lock) come first. */
#screen-settings .settings-route-row.hidden:first-child + .settings-route-row {
  border-top: 0;
}

#screen-settings .settings-route-row:hover,
#screen-settings .settings-route-row:focus-visible,
#screen-account .settings-route-row:hover,
#screen-account .settings-route-row:focus-visible {
  background: #161D2A;
}

#screen-settings .settings-route-row:active,
#screen-account .settings-route-row:active {
  transform: none;
  background: #161D2A;
}

#screen-settings .app-lock-row:hover,
#screen-settings .app-lock-row:active {
  background: transparent;
}

#screen-settings .settings-route-row strong,
#screen-account .settings-route-row strong {
  color: var(--calm-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
}

#screen-settings .settings-route-row small,
#screen-account .settings-route-row small {
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

/* One quiet stroke icon per row, no colored tile. */
#screen-settings .settings-route-icon,
#screen-account .settings-route-icon {
  width: 22px;
  height: 22px;
  border-radius: 0;
  color: var(--calm-muted);
  background: transparent;
}

#screen-settings .settings-route-icon svg,
#screen-account .settings-route-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.6;
}

#screen-settings .settings-route-chevron,
#screen-account .settings-route-chevron {
  color: var(--calm-faint);
  font-size: 22px;
  font-weight: 300;
}

/* Switches on Me match Plan's Autopilot switch: a 52x32 track, a gray knob, accent when on. */
#screen-settings .autopilot-switch input,
#accountSettingsOverlay .autopilot-switch input,
#alertsOverlay .autopilot-switch input {
  width: 52px;
  height: 32px;
  background: var(--calm-raised);
  box-shadow: none;
}

#screen-settings .autopilot-switch input::after,
#accountSettingsOverlay .autopilot-switch input::after,
#alertsOverlay .autopilot-switch input::after {
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  background: var(--calm-muted);
  box-shadow: none;
}

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

#screen-settings .autopilot-switch input:checked::after,
#accountSettingsOverlay .autopilot-switch input:checked::after,
#alertsOverlay .autopilot-switch input:checked::after {
  background: var(--calm-bg);
  transform: translateX(20px);
}

/* Account page: a back link to Me, a centred flat profile header, then the same grouped rows. */
#screen-account .account-page-nav {
  margin: -4px 0 8px -4px;
}

#screen-account .account-page-back {
  gap: 0;
  color: var(--calm-accent);
  font-size: 16px;
  font-weight: 500;
}

#screen-account .account-page-back svg {
  stroke-width: 1.8;
}

#screen-account .account-page-hero {
  gap: 4px;
  margin-bottom: 32px !important;
  padding: 4px 16px 0;
}

#screen-account .account-page-avatar {
  width: 72px;
  height: 72px;
  margin-bottom: 10px;
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
  box-shadow: none;
  font-size: 28px;
  font-weight: 400;
}

#screen-account .account-page-hero h2 {
  color: var(--calm-text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#screen-account .account-page-hero p {
  color: var(--calm-muted);
  font-size: 14px;
  font-weight: 400;
}

#screen-account .account-page-hero .settings-plan-chip {
  margin-top: 10px;
}

#screen-account .account-page-session-row {
  min-height: 60px;
  padding: 12px 18px;
  color: var(--calm-accent);
}

#screen-account .account-page-session-row.signed-in {
  color: #FF8A80;
}

#screen-account .account-page-session-row strong {
  font-size: 15px;
  font-weight: 500;
}

#screen-account .account-page-session-row small {
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
}

#screen-account .account-page-session-row:hover,
#screen-account .account-page-session-row:focus-visible {
  background: #161D2A;
}

#screen-account .account-page-delete {
  min-height: 44px;
  margin-top: 16px;
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
}

#screen-account .account-page-delete small {
  color: var(--calm-faint);
  font-size: 12px;
}

/* =====================================================================================================================
   Sign-in gate: calm ground, no aura or shine, a flat headline with one accent phrase, quiet fields, solid accent button
   ===================================================================================================================== */
.auth-gate {
  background: var(--calm-bg);
}

.auth-gate .signin-aura {
  display: none;
}

.auth-gate .signin {
  gap: 24px;
  padding-left: var(--calm-gutter);
  padding-right: var(--calm-gutter);
  padding-top: max(40px, env(safe-area-inset-top));
  font-family: var(--calm-font);
}

.auth-gate .signin-hero {
  gap: 10px;
}

.auth-gate .signin-logo {
  width: 88px;
  margin-bottom: 14px;
}

.auth-gate .signin-eyebrow {
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--calm-muted);
  background: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.auth-gate .signin-title {
  margin: 0;
  color: var(--calm-text);
  font-size: 34px;
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.auth-gate .signin-title b {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--calm-accent);
  font-weight: 300;
}

.auth-gate .signin-subcopy {
  max-width: 36ch;
  color: var(--calm-muted);
  font-size: 15px;
  line-height: 1.5;
}

/* The price preview: a flat surface card, gray bars with the cheapest hours in accent. */
.auth-gate .signin-preview {
  border: 0;
  border-radius: var(--calm-radius);
  padding: 16px 18px 12px;
  background: var(--calm-surface);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-gate .signin-preview-head {
  color: var(--calm-text);
  font-size: 13px;
  font-weight: 500;
}

.auth-gate .signin-preview-head em {
  color: var(--calm-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

.auth-gate .signin-live-dot {
  background: var(--calm-accent);
  box-shadow: none;
  animation: none;
}

.auth-gate .signin-bars i {
  border-radius: 4px 4px 2px 2px;
  background: var(--calm-track);
}

.auth-gate .signin-bars i.on {
  background: var(--calm-accent);
  box-shadow: none;
}

.auth-gate .signin-preview-axis {
  color: var(--calm-faint);
  font-size: 11px;
  font-weight: 400;
}

/* Form: no panel chrome, just the controls on the ground. */
.auth-gate .signin-panel {
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-gate .signin-tabs {
  border-radius: 16px;
  background: var(--calm-surface);
}

.auth-gate .signin-tabs::before {
  border-radius: 12px;
  background: var(--calm-raised);
  box-shadow: none;
}

.auth-gate .signin-tabs button {
  min-height: 44px;
  color: var(--calm-muted);
  font-size: 14px;
  font-weight: 400;
}

.auth-gate .signin-tabs button.active {
  color: var(--calm-text);
  font-weight: 500;
}

.auth-gate .signin-field input {
  border: 1px solid transparent;
  border-radius: var(--calm-radius-control);
  color: var(--calm-text);
  background: var(--calm-surface);
  font-size: 16px;
  font-weight: 400;
}

.auth-gate .signin-field input:focus {
  border-color: rgba(125, 184, 255, 0.55);
  background: var(--calm-surface);
  box-shadow: none;
}

.auth-gate .signin-field-label {
  color: var(--calm-faint);
  font-size: 15px;
  font-weight: 400;
}

.auth-gate .signin-field input:focus + .signin-field-label,
.auth-gate .signin-field input:not(:placeholder-shown) + .signin-field-label {
  color: var(--calm-muted);
}

.auth-gate .signin-field input:focus + .signin-field-label,
.auth-gate .signin-field:focus-within .signin-field-icon,
.auth-gate .signin-reveal[aria-pressed="true"] {
  color: var(--calm-accent);
}

.auth-gate .signin-field-icon {
  color: var(--calm-faint);
}

.auth-gate .signin-link {
  min-height: 44px;
  color: var(--calm-accent);
  font-size: 14px;
  font-weight: 500;
}

.auth-gate .signin-hint,
.auth-gate .signin-zip-status {
  color: var(--calm-faint);
  font-size: 13px;
  font-weight: 400;
}

.auth-gate .signin-zip-status[data-tone="ok"] {
  color: var(--calm-accent);
}

.auth-gate .signin-zip-status[data-tone="warn"] {
  color: var(--calm-amber);
}

.auth-gate .signin-message,
.auth-gate .signin-error {
  border: 0;
  border-radius: var(--calm-radius-control);
  font-size: 14px;
  font-weight: 400;
}

.auth-gate .signin-message {
  color: var(--calm-text);
  background: var(--calm-accent-soft);
}

.auth-gate .signin-error {
  color: #FFB4AB;
  background: rgba(255, 138, 128, 0.12);
}

.auth-gate .signin-region {
  border: 0;
  border-radius: var(--calm-radius-control);
  background: var(--calm-amber-soft);
}

.auth-gate .signin-region strong {
  font-size: 15px;
  font-weight: 500;
}

.auth-gate .signin-region p {
  color: var(--calm-muted);
  font-size: 13px;
}

.auth-gate .signin-region .signin-region-done {
  color: var(--calm-text);
  font-weight: 500;
}

.auth-gate .signin-primary {
  min-height: 52px;
  border-radius: var(--calm-radius-control);
  color: var(--calm-bg);
  background: var(--calm-accent);
  box-shadow: none;
  font-size: 16px;
  font-weight: 600;
}

.auth-gate .signin-primary::after {
  display: none;
}

.auth-gate .signin-primary:disabled {
  opacity: 0.55;
}

.auth-gate .signin-spinner {
  border-color: rgba(10, 14, 21, 0.3);
  border-top-color: var(--calm-bg);
}

.auth-gate .signin-divider {
  color: var(--calm-faint);
  font-size: 12px;
  font-weight: 500;
}

.auth-gate .signin-divider::before,
.auth-gate .signin-divider::after {
  background: var(--calm-line);
}

.auth-gate .signin-alt-button {
  border: 0;
  border-radius: var(--calm-radius-control);
  color: var(--calm-text);
  background: var(--calm-surface);
  font-size: 15px;
  font-weight: 500;
}

.auth-gate .signin-alt-button:hover {
  background: #161D2A;
}

.auth-gate .signin-alt-button svg {
  color: var(--calm-muted);
}

.auth-gate .signin-footer {
  color: var(--calm-faint);
  font-size: 12px;
  font-weight: 400;
}

.auth-gate .signin :focus-visible {
  outline-color: var(--calm-accent);
}

/* =====================================================================================================================
   Sheets opened from Me: Profile & home, Plans & billing, Utility rates, Choose your cars, Shared access
   ===================================================================================================================== */
:is(#accountSettingsOverlay, #billingSettingsOverlay, #utilitySettingsOverlay, #teslaCarsOverlay, #sharedAccessOverlay, #alertsOverlay) .sheet-top .eyebrow {
  color: var(--calm-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

:is(#accountSettingsOverlay, #billingSettingsOverlay, #utilitySettingsOverlay, #teslaCarsOverlay, #sharedAccessOverlay, #alertsOverlay) .app-sheet strong {
  font-weight: 500;
}

:is(#accountSettingsOverlay, #billingSettingsOverlay, #utilitySettingsOverlay, #teslaCarsOverlay, #sharedAccessOverlay, #alertsOverlay) .app-sheet small {
  font-weight: 400;
}

/* Profile & home: faint group labels, one surface per list, hairline rows, calm switches. */
#accountSettingsOverlay .setting-head {
  margin: 0 4px 2px;
  color: var(--calm-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

#accountSettingsOverlay .settings-list.compact-list,
#accountSettingsOverlay .delete-account-row {
  border: 0;
  border-radius: var(--calm-radius);
  background: var(--calm-bg);
}

#accountSettingsOverlay .settings-list .settings-row:not(.hidden) ~ .settings-row {
  border-top-color: var(--calm-line);
}

#accountSettingsOverlay .settings-row strong {
  color: var(--calm-text);
  font-size: 15px;
  font-weight: 400;
}

#accountSettingsOverlay .settings-row small {
  color: var(--calm-muted);
  font-size: 13px;
}

#accountSettingsOverlay .settings-row.button-row em {
  color: var(--calm-muted);
  font-size: 14px;
  font-weight: 400;
}

#accountSettingsOverlay .account-field > span {
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
}

#accountSettingsOverlay .account-field input,
#accountSettingsOverlay .account-select-row select,
#utilitySettingsOverlay input:not([type="checkbox"]):not([type="radio"]),
#utilitySettingsOverlay select {
  border: 1px solid transparent;
  border-radius: var(--calm-radius-control);
  color: var(--calm-text);
  background-color: var(--calm-bg);
  box-shadow: none;
  font-weight: 400;
}

#accountSettingsOverlay .account-field input:focus,
#utilitySettingsOverlay input:not([type="checkbox"]):not([type="radio"]):focus,
#utilitySettingsOverlay select:focus {
  border-color: rgba(125, 184, 255, 0.55);
  outline: none;
}

#accountSettingsOverlay .settings-row input[type="checkbox"] {
  width: 52px;
  height: 32px;
  background: var(--calm-raised);
  box-shadow: none;
}

#accountSettingsOverlay .settings-row input[type="checkbox"]::after {
  top: 4px;
  left: 4px;
  background: var(--calm-muted);
  box-shadow: none;
}

#accountSettingsOverlay .settings-row input[type="checkbox"]:checked {
  background: var(--calm-accent);
}

#accountSettingsOverlay .settings-row input[type="checkbox"]:checked::after {
  background: var(--calm-bg);
}

#accountSettingsOverlay .delete-account-row strong,
#accountSettingsOverlay .delete-account-row em {
  color: #FF8A80;
}

#accountSettingsOverlay .account-settings-footer {
  border-top-color: var(--calm-line);
  background: var(--calm-surface);
}

/* Tesla, inside Profile & home: a flat mark, and the key request as a quiet amber-tinted card. */
#accountSettingsOverlay .tesla-connect-mark {
  border-radius: 999px;
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
}

#accountSettingsOverlay .tesla-connect-title strong,
#accountSettingsOverlay .tesla-connect-title h3 {
  font-weight: 500;
}

#accountSettingsOverlay .tesla-key-card {
  border: 0;
  border-radius: var(--calm-radius);
  background: var(--calm-bg);
}

#accountSettingsOverlay .tesla-key-card.ready {
  background: var(--calm-bg);
}

#accountSettingsOverlay .tesla-key-icon {
  border-radius: 999px;
  color: var(--calm-amber);
  background: rgba(242, 179, 107, 0.16);
}

#accountSettingsOverlay .tesla-key-card.ready .tesla-key-icon {
  border-radius: 999px;
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
}

#accountSettingsOverlay .tesla-key-text small,
#accountSettingsOverlay .tesla-key-text p {
  color: var(--calm-muted);
  font-weight: 400;
}

#accountSettingsOverlay .tesla-text-button {
  min-height: 44px;
  color: var(--calm-accent);
  font-weight: 500;
}

/* Plans & billing: flat cards, the Pro card marked by an amber name rather than glows. */
#billingSettingsOverlay .plan-card,
#billingSettingsOverlay .plan-card.plan-pro,
#billingSettingsOverlay .plan-card.plan-pro.current,
#billingSettingsOverlay .billing-summary-card {
  border: 0;
  border-radius: var(--calm-radius);
  background: var(--calm-bg) !important;
  box-shadow: none;
}

/* The current plan is marked by the raised surface and its 'Your plan' tag, not an outline. */
#billingSettingsOverlay .plan-card.current,
#billingSettingsOverlay .plan-card.plan-pro.current {
  outline: 0;
  background: var(--calm-raised) !important;
}

#billingSettingsOverlay .plan-name {
  color: var(--calm-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

#billingSettingsOverlay .plan-pro .plan-name {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--calm-amber);
}

#billingSettingsOverlay .plan-tag,
#billingSettingsOverlay .plan-card.plan-pro .plan-tag,
#billingSettingsOverlay .plan-card.current .plan-tag {
  color: var(--calm-muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 500;
}

#billingSettingsOverlay .plan-price strong {
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -0.03em;
}

#billingSettingsOverlay .plan-price span,
#billingSettingsOverlay .plan-pitch,
#billingSettingsOverlay .plan-features span {
  color: var(--calm-muted);
  font-weight: 400;
}

#billingSettingsOverlay .plan-headline {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

#billingSettingsOverlay .plan-features strong {
  color: var(--calm-text);
  font-weight: 500;
}

#billingSettingsOverlay .plan-features svg {
  color: var(--calm-accent);
  background: transparent;
}

#billingSettingsOverlay .plan-proof {
  color: var(--calm-text);
  background: var(--calm-amber-soft);
  font-weight: 400;
}

/* Utility rates: flat hero, quiet candidates, the questionnaire chips as a segmented control. */
#utilitySettingsOverlay .utility-rate-hero {
  border: 0 !important;
  border-radius: var(--calm-radius);
  background: var(--calm-bg) !important;
  box-shadow: none !important;
}

#utilitySettingsOverlay .provider-candidate-list button {
  border: 0;
  border-radius: var(--calm-radius-control);
  background: var(--calm-bg);
  box-shadow: none;
}

#utilitySettingsOverlay .provider-candidate-list button.active {
  border: 0;
  background: var(--calm-raised);
  box-shadow: none;
}

#utilitySettingsOverlay .provider-candidate-list button span span,
#utilitySettingsOverlay .utility-rate-hero-copy small,
#utilitySettingsOverlay label > span,
#utilitySettingsOverlay .field-label {
  color: var(--calm-muted);
  font-weight: 400;
}

#utilitySettingsOverlay .utility-question-options {
  gap: 4px;
  border-radius: 16px;
  padding: 4px;
  background: var(--calm-bg);
}

#utilitySettingsOverlay .utility-question-options button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  color: var(--calm-muted);
  background: transparent;
  font-weight: 400;
}

#utilitySettingsOverlay .utility-question-options button.active {
  color: var(--calm-text);
  background: var(--calm-raised);
  font-weight: 500;
}

/* Choose your cars: one list surface with hairline rows and accent checks. */
#teslaCarsOverlay .tesla-cars-list {
  gap: 0;
  border-radius: var(--calm-radius);
  background: var(--calm-bg);
}

#teslaCarsOverlay .tesla-car-row {
  min-height: 60px;
  border: 0;
  border-radius: 0;
  padding: 12px 18px;
  background: transparent;
}

#teslaCarsOverlay .tesla-car-row + .tesla-car-row {
  border-top: 1px solid var(--calm-line);
}

#teslaCarsOverlay .tesla-car-row strong {
  font-size: 15px;
  font-weight: 500;
}

#teslaCarsOverlay .tesla-car-row small {
  color: var(--calm-muted);
  font-size: 13px;
}

#teslaCarsOverlay .tesla-car-row input {
  accent-color: var(--calm-accent);
}

#teslaCarsOverlay .tesla-cars-intro,
#teslaCarsOverlay .tesla-cars-status {
  color: var(--calm-muted);
  font-size: 14px;
  line-height: 1.45;
}

#teslaCarsOverlay .tesla-cars-save {
  min-height: 52px;
  border-radius: var(--calm-radius-control);
  color: var(--calm-bg);
  background: var(--calm-accent);
  font-weight: 600;
}

#utilitySettingsOverlay .utility-rate-shape-chart {
  background: var(--calm-surface);
}

#utilitySettingsOverlay .shape-bar.yellow {
  background: var(--calm-amber);
}

#utilitySettingsOverlay .shape-bar.blue {
  background: var(--calm-accent);
}

#utilitySettingsOverlay .shape-bar.green {
  background: #3E5B84;
}

#utilitySettingsOverlay .shape-bar em {
  color: var(--calm-muted);
  font-weight: 400;
}

#utilitySettingsOverlay .utility-rate-tag {
  border: 0;
  color: var(--calm-muted);
  background: var(--surface-soft);
  font-weight: 500;
}

#utilitySettingsOverlay .utility-rate-tag.hourly,
#utilitySettingsOverlay .utility-rate-tag.tou {
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
}

#utilitySettingsOverlay .utility-compat-note {
  border: 0;
  color: var(--calm-muted);
  background: var(--calm-bg);
  font-weight: 400;
}

#utilitySettingsOverlay .sheet-top {
  margin-bottom: 16px;
}

/* Plans & billing fine print and the current-plan summary. */
#billingSettingsOverlay .plan-fineprint,
#billingSettingsOverlay .panel-note {
  color: var(--calm-faint);
  font-size: 13px;
  font-weight: 400;
}

#billingSettingsOverlay .billing-summary-head .chip,
#billingSettingsOverlay .billing-summary-head em {
  font-style: normal;
  font-weight: 500;
}

#billingSettingsOverlay .billing-detail-list,
#billingSettingsOverlay .billing-detail-list * {
  font-size: 14px;
}

#billingSettingsOverlay .billing-detail-list strong,
#billingSettingsOverlay .billing-detail-list dd {
  font-weight: 400;
}

/* =====================================================================================================================
   Setup journey (#setupOverlay): flat hero, a soft round symbol, choices as plain surface rows
   ===================================================================================================================== */
#setupOverlay .setup-sheet {
  padding-left: var(--calm-gutter);
  padding-right: var(--calm-gutter);
}

#setupOverlay .setup-top h2 {
  color: var(--calm-text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

#setupOverlay .setup-top .eyebrow {
  color: var(--calm-muted);
}

#setupOverlay .setup-step-pill {
  min-height: 32px;
  color: var(--calm-muted);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 500;
}

#setupOverlay .setup-progress span {
  background: var(--calm-track);
}

#setupOverlay .setup-progress span.active,
#setupOverlay .setup-progress span.complete {
  background: var(--calm-accent);
}

#setupOverlay .setup-step-card {
  border: 0 !important;
  box-shadow: none !important;
}

#setupOverlay .setup-hero,
#setupOverlay .onboarding-symbol,
#setupOverlay .onboarding-symbol.bolt,
#setupOverlay .onboarding-symbol.done {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
  box-shadow: none;
}

#setupOverlay .setup-hero svg {
  fill: none;
  stroke: currentColor;
}

#setupOverlay .setup-hero-copy h3 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

#setupOverlay .setup-copy {
  color: var(--calm-muted);
  font-size: 15px;
  line-height: 1.5;
}

#setupOverlay .setup-benefits,
#setupOverlay .setup-benefits li {
  color: var(--calm-muted);
  font-weight: 400;
}

#setupOverlay .setup-benefits strong {
  color: var(--calm-text);
  font-weight: 500;
}

#setupOverlay .setup-choice-panel,
#setupOverlay .setup-pairing-panel {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

#setupOverlay .setup-choice {
  min-height: 72px;
  border: 0;
  border-radius: var(--calm-radius);
  padding: 16px 18px;
  background: var(--calm-surface);
}

#setupOverlay .setup-choice.active {
  background: var(--calm-raised);
}

#setupOverlay .setup-choice strong {
  font-size: 16px;
  font-weight: 500;
}

#setupOverlay .setup-choice small {
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

#setupOverlay .setup-choice .device-icon {
  border-radius: 999px;
  color: var(--calm-muted);
  background: transparent;
}

#setupOverlay .setup-skip {
  min-height: 44px;
  color: var(--calm-accent);
  font-weight: 500;
}

/* Tesla sign-in interstitial: no fake browser chrome, just a lock and a sentence on a flat card. */
#teslaAuthOverlay .tesla-logo-mark {
  border-radius: 999px;
  color: var(--calm-text);
  background: var(--surface-soft);
  box-shadow: none;
}

#teslaAuthOverlay .tesla-auth-top h2 {
  font-size: 20px;
  font-weight: 500;
}

#teslaAuthOverlay #teslaAuthCopy {
  color: var(--calm-muted);
  font-size: 15px;
  line-height: 1.5;
}

#teslaAuthOverlay .tesla-auth-browser {
  border: 0;
  border-radius: var(--calm-radius);
  background: var(--calm-bg);
}

#teslaAuthOverlay .browser-bar {
  display: none;
}

#teslaAuthOverlay .browser-body {
  background: transparent;
}

#teslaAuthOverlay .tesla-lock {
  border-radius: 999px;
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
  box-shadow: none;
}

#teslaAuthOverlay .browser-body strong {
  font-weight: 500;
}

#teslaAuthOverlay .browser-body small {
  color: var(--calm-muted);
  font-weight: 400;
}

/* Shared access sheet body. */
#sharedAccessOverlay .shared-access-body {
  color: var(--calm-muted);
}

#teslaAuthOverlay #teslaAuthCopy {
  margin-top: 12px;
}

#teslaAuthOverlay .tesla-auth-actions {
  margin-top: 16px;
}

/* Me title matches Today, Plan and Savings (legacy styles.css sets 1.9rem by id). */
#screen-settings .screen-heading h2 {
  font-size: 26px;
}

/* Approve in Tesla meets the 44px touch target. */
#accountSettingsOverlay #teslaKeyApproveLink {
  min-height: 44px;
}

/* =====================================================================================================================
   Text fit: nothing on Me or the sheets it opens is cut off, ellipsized when it matters, or pushed off a narrow phone.
   Legacy styles.css clips names, emails, card numbers and buttons with nowrap + ellipsis; these let them wrap instead.
   ===================================================================================================================== */

/* Long names and emails wrap (emails break anywhere, since they have no spaces) instead of ending in "...". */
#screen-settings .settings-profile-hero strong,
#screen-settings .settings-profile-hero small,
#screen-account .account-page-hero h2,
#screen-account .account-page-hero p,
#screen-account .account-page-session-row small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

#screen-settings .settings-profile-hero > span:nth-child(2) {
  grid-template-columns: minmax(0, 1fr);
}

#screen-settings .settings-profile-hero .settings-plan-chip {
  justify-self: start;
  max-width: 100%;
}

/* Row subtitles avoid a lone last word ("AM") where the browser can. */
#screen-settings .settings-route-row small,
#screen-account .settings-route-row small,
#accountSettingsOverlay .settings-row small {
  text-wrap: pretty;
}

/* Profile & home: first and last name share a row only when there is room for a real name; on narrow phones they
   stack. Long values in the fields end in an ellipsis rather than a cut glyph (the field still scrolls when edited). */
#accountSettingsOverlay .account-field input {
  min-width: 0;
  text-overflow: ellipsis;
}

@media (max-width: 374px) {
  #accountSettingsOverlay .account-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Delete account confirm: both buttons keep their words on one line and meet the 44px touch target. */
#accountSettingsOverlay .delete-account-actions {
  flex-wrap: wrap;
}

#accountSettingsOverlay .delete-account-actions button {
  min-height: 44px;
  flex: 0 0 auto;
  white-space: nowrap;
}

#accountSettingsOverlay #deleteAccountCancelButton {
  padding: 0 12px;
}

/* Utility rates: Select Provider and Take Questionnaire share the row and wrap their words instead of running off
   the right edge. */
#utilitySettingsOverlay .utility-actions > button {
  min-width: 0;
  flex: 1 1 0;
  height: auto;
  min-height: 44px;
  padding: 10px 14px;
  line-height: 1.25;
  white-space: normal;
}

/* Wallet and checkout: card names and numbers ("Visa •• 1390", "American Express •• 9537") are shown in full and
   wrap if they must; the Default tag stays beside them. */
:is(#walletOverlay, #billingCardOverlay) .wallet-method {
  gap: 10px;
  padding-left: 12px;
  padding-right: 12px;
}

:is(#walletOverlay, #billingCardOverlay) .wallet-method-text strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

:is(#walletOverlay, #billingCardOverlay) .wallet-method em {
  white-space: nowrap;
}

#walletOverlay .wallet-cancel-link {
  min-height: 44px;
}

/* Choose what reVolt controls: the button row no longer has a 246px minimum, so it fits inside a 320px sheet, and
   Connect Vehicle stays on one line. */
#targetPickerOverlay .target-picker-actions {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
}

#targetPickerOverlay .target-option-list,
#targetPickerOverlay .target-option {
  min-width: 0;
  max-width: 100%;
}

#targetPickerOverlay .target-picker-setup-actions {
  grid-template-columns: minmax(0, 1fr);
}

#targetPickerOverlay .target-picker-setup-actions button,
#targetPickerOverlay .target-picker-actions button {
  min-width: 0;
  min-height: 44px;
  white-space: nowrap;
}

/* Help & diagnostics: on narrow phones the health check is one list of label / value rows rather than tiles that
   squeeze a car name into five lines. */
@media (max-width: 374px) {
  #supportDiagnosticsOverlay .diagnostic-status-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #supportDiagnosticsOverlay .diagnostic-status-grid > div {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: baseline;
    column-gap: 12px;
  }

  #supportDiagnosticsOverlay .diagnostic-status-grid strong {
    text-align: right;
  }
}

/* Shared access. Its legacy rules in styles.css sit inside an unclosed `.tesla-cars-save:disabled {` block, so they
   only ever matched inside that button and the sheet rendered with browser-default gray buttons overlapping long
   names. These restate them in the calm style: one surface per list, hairline rows, text on top and the actions on
   their own line below it, so long names and emails never run under a button. */
#sharedAccessOverlay .settings-subsection {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#sharedAccessOverlay .settings-subsection + .settings-subsection {
  margin-top: 26px;
}

#sharedAccessOverlay .setting-head {
  margin: 0 4px 2px;
  padding: 0;
  color: var(--calm-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

#sharedAccessOverlay .settings-list.compact-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--calm-radius);
  padding: 0;
  background: var(--calm-bg);
}

#sharedAccessOverlay .shared-access-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  min-height: 60px;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 12px 16px;
  background: transparent;
  box-shadow: none;
}

#sharedAccessOverlay .shared-access-row + .shared-access-row,
#sharedAccessOverlay .shared-access-row + .shared-access-note {
  border-top: 1px solid var(--calm-line);
}

#sharedAccessOverlay .shared-access-row > span:first-child {
  display: grid;
  flex: 1 1 100%;
  gap: 2px;
  min-width: 0;
}

#sharedAccessOverlay .shared-access-row strong {
  color: var(--calm-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#sharedAccessOverlay .shared-access-row small {
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#sharedAccessOverlay .shared-access-actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#sharedAccessOverlay .shared-access-actions:empty {
  display: none;
}

#sharedAccessOverlay .shared-access-btn {
  flex: 0 0 auto;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: var(--calm-text);
  background: var(--calm-raised);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

#sharedAccessOverlay .shared-access-btn.primary {
  color: var(--calm-bg);
  background: var(--calm-accent);
  font-weight: 600;
}

#sharedAccessOverlay .shared-access-btn:disabled {
  opacity: 0.55;
}

#sharedAccessOverlay .shared-access-role {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--calm-radius-control);
  padding: 0 12px;
  color: var(--calm-text);
  background-color: var(--calm-raised);
  font: inherit;
  font-size: 14px;
}

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

#sharedAccessOverlay .shared-access-invite .account-field {
  display: grid;
  gap: 6px;
}

#sharedAccessOverlay .shared-access-invite .account-field > span {
  margin: 0 4px;
  color: var(--calm-muted);
  font-size: 13px;
}

#sharedAccessOverlay .shared-access-invite input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: var(--calm-radius-control);
  padding: 0 14px;
  color: var(--calm-text);
  background: var(--calm-bg);
  font: inherit;
  text-overflow: ellipsis;
}

#sharedAccessOverlay .shared-access-invite .shared-access-role {
  background-color: var(--calm-bg);
}

#sharedAccessOverlay .shared-access-invite .shared-access-btn {
  justify-self: stretch;
  min-height: 48px;
}

#sharedAccessOverlay .shared-access-note {
  margin: 6px 4px 10px;
  color: var(--calm-muted);
  font-size: 14px;
  line-height: 1.45;
}

#sharedAccessOverlay .settings-list .shared-access-note {
  margin: 0;
  padding: 14px 16px;
}

#sharedAccessOverlay .shared-access-note.error {
  color: #FF8A80;
}

/* The banner shown while viewing an account shared with you (same unclosed-block problem). The name wraps rather
   than ending in "...". */
#sharedAccountBanner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 12px 0;
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--calm-text);
  background: var(--calm-accent-soft);
}

#sharedAccountBanner.hidden {
  display: none;
}

#sharedAccountBanner span {
  display: grid;
  min-width: 0;
}

#sharedAccountBanner strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}

#sharedAccountBanner small {
  color: var(--calm-muted);
}

#sharedAccountBanner button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--calm-bg);
  background: var(--calm-accent);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

/* Shared access spacing and the role picker's chevron, inset from the edge like the other selects on Me. */
#sharedAccessOverlay .shared-access-body {
  margin-top: 16px;
}

#sharedAccessOverlay .settings-subsection > .shared-access-note {
  margin: 0 4px 4px;
}

#sharedAccessOverlay .shared-access-role {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6b0ba' 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 14px center;
  background-repeat: no-repeat;
  background-size: 14px;
  text-overflow: ellipsis;
}

/* Profile card: a little air between a wrapped email and the chevron. */
#screen-settings .settings-profile-hero > span:nth-child(2) {
  padding-right: 4px;
}

/* Wallet: See reVolt Pro meets the 44px touch target. */
#walletOverlay #walletUpgradeButton {
  min-height: 44px;
}

/* Delete account confirm: a lighter weight keeps "Delete account" on one line; when the two buttons cannot share a
   row they stack full width, the destructive one first. */
#accountSettingsOverlay .delete-account-submit {
  padding: 0 16px;
  font-weight: 600;
}

#accountSettingsOverlay .delete-account-actions button {
  flex: 1 1 auto;
}

@media (max-width: 374px) {
  #accountSettingsOverlay .delete-account-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  #accountSettingsOverlay .delete-account-submit {
    order: -1;
  }
}

/* Wallet and checkout on narrow phones: the Default tag moves under the card's name and expiry, so the name and
   last four digits get the full width. */
@media (max-width: 374px) {
  :is(#walletOverlay, #billingCardOverlay) .wallet-method:has(> em) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 4px;
  }

  :is(#walletOverlay, #billingCardOverlay) .wallet-method:has(> em) > .card-mark {
    grid-row: span 2;
    align-self: center;
  }

  :is(#walletOverlay, #billingCardOverlay) .wallet-method:has(> em) > em {
    grid-column: 2;
    justify-self: start;
  }
}

/* Profile card on narrow phones: a slightly smaller initial and tighter gaps give a long name room to break at its
   hyphen rather than mid-word. */
@media (max-width: 374px) {
  #screen-settings .settings-profile-hero {
    grid-template-columns: 44px minmax(0, 1fr) 16px;
    gap: 12px;
    padding: 16px 14px 16px 16px;
  }

  #screen-settings .settings-profile-hero .settings-account-avatar {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* Sign-in gate (shown after Sign out): a long remembered email ends in an ellipsis instead of a cut letter, and the
   show-password eye meets the 44px touch target. */
.auth-gate .signin-field input {
  text-overflow: ellipsis;
}

.auth-gate .signin-reveal {
  right: 6px;
  width: 44px;
  height: 44px;
}

/* Help & diagnostics: room between the title, the health check and the note under it. */
#supportDiagnosticsOverlay .diagnostic-status-grid {
  margin-top: 12px;
}

#supportDiagnosticsOverlay #supportDiagnosticsCopy {
  margin-top: 14px;
}

/* =====================================================================================================================
   Text fit, pass 2: short subtitles and labels break where a reader would pause, never mid-phrase.
   ===================================================================================================================== */

/* Row subtitles on Me, Account and the sheets they open wrap as two even lines, so a time range ("10 PM–6 AM"),
   a date or "scheduled automatically" moves down whole instead of leaving "6 AM" alone on the second line. */
#screen-settings .settings-route-row small,
#screen-account .settings-route-row small,
#accountSettingsOverlay .settings-row small,
#sharedAccessOverlay .shared-access-row small {
  text-wrap: balance;
}

/* Account page: the phone number in "Name, email · +1 (312) 555-0199" moves to the next line whole. */
#screen-account .account-page-phone {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Sign-in: "Continue with secure web sign-in" wraps as "Continue with secure / web sign-in", not "sign- / in". */
.auth-gate .signin-alt-button span {
  text-wrap: balance;
}

/* Profile card on narrow phones: one size down gives a long hyphenated name room to break at its hyphen
   ("Featherstonehaugh- / Worthington") instead of starting a line with "-Worthington". */
@media (max-width: 374px) {
  #screen-settings .settings-profile-hero strong {
    font-size: 16px;
  }
}

/* Plans & billing: the price in "Start reVolt Pro · $2.99/mo" never splits; on the narrowest phones, where the line
   cannot fit, the price sits on its own line under "Start reVolt Pro" instead of wrapping after the "·". */
#billingSettingsOverlay .plan-cta-price {
  white-space: nowrap;
}

@media (max-width: 352px) {
  #billingSettingsOverlay .plan-cta {
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.25;
  }

  #billingSettingsOverlay .plan-cta-separator {
    display: none;
  }

  #billingSettingsOverlay .plan-cta-price {
    display: block;
    font-size: 14px;
    font-weight: 500;
  }
}

/* Me and Account row subtitles show every line. Legacy styles.css clamps them at two lines with "...", which cut
   "Viewing Alexandria Montgomery-Smythe Household's account" short on a narrow phone. */
#screen-settings .settings-route-row small,
#screen-account .settings-route-row small {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  text-overflow: clip;
}

/* Shared account banner: the name sits beside "Back to mine"; on narrow phones it takes the full width, with the
   role and the button on the row below, so a long name wraps into two lines rather than five. */
#sharedAccountBanner:not(.hidden) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name action"
    "role action";
  align-items: center;
  column-gap: 12px;
}

#sharedAccountBanner > span {
  display: contents;
}

#sharedAccountBanner strong {
  grid-area: name;
  align-self: end;
}

#sharedAccountBanner small {
  grid-area: role;
  align-self: start;
}

#sharedAccountBanner button {
  grid-area: action;
}

@media (max-width: 374px) {
  #sharedAccountBanner:not(.hidden) {
    grid-template-areas:
      "name name"
      "role action";
    row-gap: 2px;
  }

  #sharedAccountBanner small {
    align-self: center;
  }

  #sharedAccountBanner button {
    padding: 0 14px;
    font-size: 15px;
  }
}

/* Rev follows the banner down by the room it really takes (set by 12c-shared-access.js), so a banner that grows
   for a long name never runs under it. */
#sharedAccountBanner:not(.hidden) ~ .rev-button {
  top: calc(20px + var(--shared-banner-space, 64px));
}

body.native-app #sharedAccountBanner:not(.hidden) ~ .rev-button {
  top: calc(max(20px, calc(env(safe-area-inset-top, 0px) + 8px)) + var(--shared-banner-space, 64px));
}

/* Me > Unlock with fingerprint (Android): the switch gets a column as wide as itself, so the subtitle wraps before it
   instead of running under it (the row's last column is sized for a 16px chevron). */
#screen-settings .app-lock-row {
  grid-template-columns: 22px minmax(0, 1fr) auto;
}

/* Utility rates: a rate plan shows its whole name ("Time-of-Use Electric Vehicle Charging Rate Schedule EV-TOU-5 ...");
   legacy styles.css stops it at two lines with "...", and the name is what tells two plans apart. */
#utilitySettingsOverlay .rate-card-option strong {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

/* Utility rates hero: a long plan name gets the card's full width, with the price shape under it, rather than a
   six-line column beside the chart. Short names keep the two columns. */
#utilitySettingsOverlay .utility-rate-hero[data-long-title="true"] {
  grid-template-columns: minmax(0, 1fr);
}

#utilitySettingsOverlay .utility-rate-hero[data-long-title="true"] .utility-rate-shape-chart {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 32px;
  justify-content: space-evenly;
  min-height: 76px;
}

/* Fix-it sheet (Help & support > a problem > Recover): each fact is a label / value row, so a long car name wraps
   beside "Target" instead of running out of a one-third-width tile and under the next one. */
#failureRecoveryOverlay .assumption-grid {
  grid-template-columns: minmax(0, 1fr);
}

#failureRecoveryOverlay .assumption-grid > div {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 16px;
}

#failureRecoveryOverlay .assumption-grid strong {
  min-width: 0;
  overflow-wrap: break-word;
  text-align: right;
}

/* Tesla sign-in sheet: Cancel and Open Tesla meet the 44px touch target. */
#teslaAuthOverlay .tesla-auth-actions button {
  min-height: 44px;
}

/* =====================================================================================================================
   Two-step sign-in: on the sign-in screen (the code, choosing where to get it, "Secure your account") and in
   Me > Security. The setup pieces (.two-step-*) look the same in both; fields sit on the surface a step darker or
   lighter than what's around them.
   ===================================================================================================================== */
.auth-gate .two-step-gate {
  --two-step-field: var(--calm-surface);
}

.two-step-sheet {
  --two-step-field: var(--calm-bg);
}

.two-step-form,
.two-step-panel,
.two-step-code {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.two-step-panel {
  gap: 14px;
}

.two-step-label {
  color: var(--calm-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* One code field: six spaced digits, centred and large enough to check at a glance. */
.two-step-code-input {
  width: 100%;
  min-height: 64px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--calm-radius-control);
  padding: 0 8px 0 calc(8px + 0.34em);
  color: var(--calm-text);
  background: var(--two-step-field, var(--calm-surface));
  box-shadow: none;
  font-family: var(--calm-font);
  font-size: 28px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.34em;
  text-align: center;
}

.two-step-code-input::placeholder {
  color: #3A4558;
  opacity: 1;
}

.two-step-code-input:focus,
.two-step-phone:focus-within {
  border-color: rgba(125, 184, 255, 0.55);
  outline: none;
}

.two-step-code-input:disabled {
  opacity: 0.6;
}

/* Text message or authenticator app: a two-way segmented control. */
.two-step-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border-radius: 16px;
  padding: 4px;
  background: var(--two-step-field, var(--calm-surface));
}

.two-step-method {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 6px 4px;
  color: var(--calm-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.two-step-method[aria-pressed="true"] {
  color: var(--calm-text);
  background: var(--calm-raised);
  font-weight: 500;
}

/* Mobile number: a fixed +1 in front of the field. */
.two-step-phone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: var(--calm-radius-control);
  padding: 0 16px;
  background: var(--two-step-field, var(--calm-surface));
}

.two-step-phone-prefix {
  flex: none;
  color: var(--calm-muted);
  font-size: 17px;
}

.two-step-phone input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  margin: 0;
  border: 0;
  padding: 0;
  color: var(--calm-text);
  background: transparent;
  box-shadow: none;
  font-size: 17px;
  outline: none;
}

.two-step-phone input::placeholder {
  color: #3A4558;
  opacity: 1;
}

.two-step-consent,
.two-step-intro,
.two-step-lead,
.two-step-note,
.two-step-help {
  margin: 0;
  color: var(--calm-muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.two-step-intro,
.two-step-lead {
  font-size: 15px;
}

.two-step-consent strong,
.two-step-lead strong {
  color: var(--calm-text);
  font-weight: 500;
}

.two-step-consent a,
.two-step-help a {
  color: var(--calm-accent);
  text-decoration: none;
}

.two-step-help {
  text-align: center;
}

/* Buttons: one solid accent action per step; quieter surface and text buttons around it. */
.two-step-primary,
.two-step-secondary,
.two-step-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--calm-radius-control);
  padding: 8px 16px;
  font-family: var(--calm-font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.two-step-primary {
  color: var(--calm-bg);
  background: var(--calm-accent);
}

.two-step-secondary {
  color: var(--calm-text);
  background: var(--two-step-field, var(--calm-surface));
  font-size: 15px;
  font-weight: 500;
}

.two-step-secondary svg,
.two-step-copy svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--calm-muted);
}

.two-step-danger {
  color: #FFB4AB;
  background: rgba(255, 138, 128, 0.12);
  font-size: 15px;
  font-weight: 500;
}

.two-step-primary:disabled,
.two-step-secondary:disabled,
.two-step-danger:disabled {
  opacity: 0.55;
}

.two-step-primary.is-busy:disabled {
  opacity: 0.8;
}

.two-step-link,
.two-step-back {
  justify-self: center;
  min-height: 44px;
  border: 0;
  padding: 0 8px;
  color: var(--calm-accent);
  background: transparent;
  font-family: var(--calm-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.two-step-back {
  justify-self: start;
  margin: -8px 0 0 -8px;
}

.two-step-links,
.two-step-gate-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
}

.auth-gate .two-step-gate-links .signin-link {
  padding: 0 6px;
}

.two-step-spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(154, 164, 178, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: two-step-spin 0.8s linear infinite;
}

@keyframes two-step-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .two-step-spinner {
    animation-duration: 2.4s;
  }
}

.two-step-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  margin: 0;
}

/* reVolt plans: Drive, Home and One as three quiet cards, then Free. The current plan sits on the raised surface with
   a "Your plan" tag; the plan an upgrade prompt points to gets a thin accent edge and the filled button. */
#billingSettingsOverlay .plan-picker {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

#billingSettingsOverlay .plan-grace {
  display: grid;
  gap: 4px;
  border-radius: var(--calm-radius-control);
  padding: 14px 16px;
  background: var(--calm-amber-soft);
}

#billingSettingsOverlay .plan-grace strong {
  color: var(--calm-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

#billingSettingsOverlay .plan-grace span {
  color: var(--calm-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.85;
}

#billingSettingsOverlay .plan-option {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--calm-radius);
  padding: 18px;
  background: var(--calm-bg);
}

#billingSettingsOverlay .plan-option.current {
  background: var(--calm-raised);
}

#billingSettingsOverlay .plan-option.suggested {
  border-color: var(--calm-accent);
}

#billingSettingsOverlay .plan-option-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  min-width: 0;
}

#billingSettingsOverlay .plan-option-name {
  margin: 0;
  color: var(--calm-text);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

#billingSettingsOverlay .plan-option-tag {
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--calm-muted);
  background: var(--calm-track);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
}

#billingSettingsOverlay .plan-option-tag-best {
  color: var(--calm-amber);
  background: var(--calm-amber-soft);
}

#billingSettingsOverlay .plan-option-for,
#billingSettingsOverlay .plan-option-note {
  margin: 0;
  color: var(--calm-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

#billingSettingsOverlay .plan-option-note {
  font-size: 13px;
}

#billingSettingsOverlay .plan-option-note.warn {
  color: var(--calm-amber);
}

#billingSettingsOverlay .plan-option-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 2px 0 0;
}

#billingSettingsOverlay .plan-option-price strong {
  color: var(--calm-text);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

#billingSettingsOverlay .plan-option-price span {
  color: var(--calm-muted);
  font-size: 14px;
}

.two-step-error {
  margin: 0;
  border-radius: var(--calm-radius-control);
  padding: 12px 14px;
  color: #FFB4AB;
  background: rgba(255, 138, 128, 0.12);
  font-size: 14px;
  line-height: 1.45;
}

/* Authenticator app: two numbered steps; the QR code on its own white tile so any camera reads it. */
.two-step-steps {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: two-step;
}

.two-step-steps > li {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-left: 36px;
  counter-increment: two-step;
}

.two-step-steps > li::before {
  content: counter(two-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--calm-text);
  background: var(--calm-raised);
  font-size: 13px;
  font-weight: 600;
}

.two-step-steps > li > strong {
  color: var(--calm-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.two-step-steps > li > span {
  color: var(--calm-muted);
  font-size: 14px;
  line-height: 1.5;
}

.two-step-qr {
  justify-self: center;
  width: min(196px, 100%);
  border-radius: 16px;
  padding: 6px;
  background: #FFFFFF;
}

.two-step-qr .two-step-qr-svg {
  display: block;
  width: 100%;
  height: auto;
}

.two-step-qr .two-step-qr-svg rect {
  fill: #FFFFFF;
  stroke: none;
}

.two-step-qr .two-step-qr-svg path {
  fill: #0A0E15;
  stroke: none;
}

.two-step-key {
  display: grid;
  gap: 6px;
  border-radius: var(--calm-radius-control);
  padding: 12px 8px 4px 14px;
  background: var(--two-step-field, var(--calm-surface));
}

.two-step-key-label {
  color: var(--calm-muted);
  font-size: 12px;
}

.two-step-key .two-step-copy {
  justify-self: start;
  margin-left: -10px;
}

.two-step-key-value {
  min-width: 0;
  color: var(--calm-text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

.two-step-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--calm-accent);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

.two-step-copy svg {
  color: currentColor;
}

/* Choosing where to get the code at sign-in: two full-width rows. */
.two-step-choices {
  display: grid;
  gap: 10px;
}

.two-step-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  border: 0;
  border-radius: var(--calm-radius-control);
  padding: 12px 16px;
  color: var(--calm-text);
  background: var(--calm-surface);
  text-align: left;
}

.two-step-choice-icon svg,
.two-step-choice-arrow svg,
.two-step-method-icon svg,
.two-step-status-icon svg,
.two-step-notice svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

#billingSettingsOverlay .plan-option-benefits {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#billingSettingsOverlay .plan-option-benefits li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 0;
}

#billingSettingsOverlay .plan-option-benefits li::before {
  content: none;
}

#billingSettingsOverlay .plan-option-benefits svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  fill: none;
  stroke: var(--calm-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.two-step-choice-icon,
.two-step-method-icon {
  color: var(--calm-accent);
}

.two-step-choice-arrow {
  color: var(--calm-faint);
}

.two-step-choice-arrow svg {
  width: 18px;
  height: 18px;
}

.two-step-choice-text,
.two-step-method-text,
.two-step-status > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.two-step-choice-text strong,
.two-step-method-text strong,
.two-step-status strong {
  color: var(--calm-text);
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: break-word;
}

.two-step-choice-text small,
.two-step-method-text small,
.two-step-status small {
  color: var(--calm-muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: break-word;
}

/* Me > Security sheet. */
.two-step-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  min-width: 0;
}

.two-step-heading {
  margin: 0;
  color: var(--calm-text);
  font-size: 17px;
  font-weight: 500;
}

.two-step-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.two-step-status-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--calm-accent);
  background: var(--calm-accent-soft);
}

.two-step-method-list {
  display: grid;
  margin: 0;
  border-radius: var(--calm-radius-control);
  padding: 0;
  background: var(--calm-bg);
  list-style: none;
}

.two-step-method-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 8px 10px 16px;
}

.two-step-method-row + .two-step-method-row {
  border-top: 1px solid var(--calm-line);
}

.two-step-remove {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--calm-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

.two-step-add {
  display: grid;
  gap: 10px;
}

.two-step-off {
  color: #FFB4AB;
}

.two-step-confirm {
  display: grid;
  gap: 10px;
  border-radius: var(--calm-radius-control);
  padding: 16px;
  background: var(--calm-bg);
}

.two-step-confirm strong {
  color: var(--calm-text);
  font-size: 16px;
  font-weight: 500;
}

.two-step-confirm p {
  margin: 0;
  color: var(--calm-muted);
  font-size: 14px;
  line-height: 1.45;
}

.two-step-confirm-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.two-step-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  border-radius: var(--calm-radius-control);
  padding: 12px 14px;
  color: var(--calm-text);
  background: var(--calm-accent-soft);
  font-size: 14px;
  line-height: 1.45;
}

.two-step-notice svg {
  width: 20px;
  height: 20px;
  color: var(--calm-accent);
}

.two-step-notice:focus {
  outline: none;
}

.two-step-notice:focus-visible {
  outline: 2px solid var(--calm-accent);
}

.two-step-status:focus,
.auth-gate .two-step-gate .signin-title:focus {
  outline: none;
}

/* Focus lands on the status only so screen readers hear the change; it isn't a control, so no ring. */
.two-step-status:focus-visible {
  outline: none;
}

.two-step-confirm .two-step-secondary {
  background: var(--calm-surface);
}

/* A phone number never breaks across lines. */
.two-step-number {
  white-space: nowrap;
}

/* Small phones: the sheet gives its content a little more room. */
@media (max-width: 360px) {
  .app-sheet.two-step-sheet {
    padding-right: 18px;
    padding-left: 18px;
  }
}

/* The narrowest phones (320 px) keep every label on one line: "Authenticator app" in the picker, the methods without
   their decorative icons, and the authenticator steps using the full width under their numbers. */
@media (max-width: 340px) {
  .two-step-method {
    padding-right: 2px;
    padding-left: 2px;
    font-size: 13px;
  }

  .two-step-method-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding-left: 16px;
  }

  .two-step-method-icon {
    display: none;
  }

  .two-step-steps > li {
    padding-left: 0;
  }

  .two-step-steps > li > strong {
    padding-left: 36px;
  }
}

/* Two-step sign-in paragraphs don't end on a lone short word where the browser can help it. */
.two-step-gate .signin-subcopy,
.two-step-intro,
.two-step-lead,
.two-step-steps > li > strong,
.two-step-steps > li > span,
.two-step-consent,
.two-step-note,
.two-step-help,
.two-step-status small,
.two-step-confirm p {
  text-wrap: pretty;
}

#billingSettingsOverlay .plan-option-benefits span {
  color: var(--calm-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#billingSettingsOverlay .plan-option-cta {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  white-space: normal;
}

#billingSettingsOverlay .plan-option-free {
  gap: 6px;
  padding: 16px 18px;
}

#billingSettingsOverlay .plan-option-free .plan-option-name {
  font-size: 15px;
}

#billingSettingsOverlay .plan-option-free .plan-option-for {
  font-size: 13px;
}

#billingSettingsOverlay .plan-picker-note,
#billingSettingsOverlay .plan-picker-terms {
  margin: 0;
  color: var(--calm-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

#billingSettingsOverlay .plan-picker-terms {
  color: var(--calm-faint);
  font-size: 12px;
}

#billingSettingsOverlay .plan-cancel-link {
  display: block;
  min-height: 44px;
  margin: 4px 0 0;
  border: 0;
  padding: 10px 0;
  color: var(--calm-muted);
  background: none;
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Checkout for a plan change: the credit for time left sits between the plan and what's due. */
#billingCardOverlay .checkout-summary > div {
  min-width: 0;
}

#billingCardOverlay .checkout-summary > div > span,
#billingCardOverlay .checkout-summary > div > strong:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

#billingCardOverlay .checkout-summary > div > strong:last-child:not(:first-child),
#billingCardOverlay .checkout-summary > div > span:last-child:not(:first-child) {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#billingCardOverlay .checkout-credit strong {
  color: var(--calm-accent);
  font-weight: 500;
}

/* Saved cards in the wallet and at checkout: the last four digits always show. The card's name wraps rather than
   cutting off, and on narrow phones the row is tighter so it usually stays on one line. */
#walletOverlay .wallet-method-text strong,
#billingCardOverlay .wallet-method-text strong {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

@media (max-width: 360px) {
  #walletOverlay .wallet-method,
  #billingCardOverlay .wallet-method {
    gap: 10px;
    padding: 10px 12px;
  }

  #walletOverlay .wallet-method .card-mark,
  #billingCardOverlay .wallet-method .card-mark {
    width: 40px;
    height: 28px;
    font-size: 10px;
  }
}

/* reVolt plans: what a plan change turns off, under the total in checkout. */
#billingCardOverlay .checkout-loses {
  margin: 4px 0 0;
  color: var(--calm-amber);
  font-size: 14px;
  line-height: 1.4;
}

/* reVolt plans: the billing terms under the plans are read before paying, so they keep 4.5:1 contrast. */
#billingSettingsOverlay .plan-picker-terms {
  color: var(--calm-muted);
}
