.sp-user-menu {
  position: relative;
  flex: 0 0 auto;
}

.sp-user-menu-trigger {
  cursor: pointer;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.sp-user-menu-trigger > * {
  pointer-events: none;
}

.sp-user-menu-trigger:hover,
.sp-user-menu-trigger[aria-expanded="true"] {
  border-color: rgba(255, 123, 41, 0.65);
  box-shadow: 0 12px 28px rgba(255, 123, 41, 0.16);
  transform: translateY(-1px);
}

.sp-user-menu-chevron {
  color: var(--sp-text-muted);
  font-size: 1.1rem;
}

.sp-account-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: min(92vw, 320px);
  padding: 0.6rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 123, 41, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 123, 41, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(20, 12, 10, 0.98), rgba(10, 6, 6, 0.98));
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 1004;
}

.sp-account-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.sp-account-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.82rem 0.85rem;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--sp-text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.sp-account-menu-item:hover,
.sp-account-menu-item:focus-visible {
  background: rgba(255, 123, 41, 0.12);
  color: #fff4ea;
  transform: translateX(2px);
  outline: none;
}

.sp-account-menu-item .material-icons {
  font-size: 1.2rem;
  color: #ffb172;
  margin-top: 0.1rem;
}

.sp-account-menu-item span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.sp-account-menu-item strong,
.sp-account-menu-item small {
  display: block;
}

.sp-account-menu-item small {
  color: var(--sp-text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.sp-account-menu-item--danger {
  color: #ffd0c7;
}

.sp-account-menu-item--danger .material-icons {
  color: #ff9b87;
}

.sp-account-menu-divider {
  height: 1px;
  margin: 0.35rem 0;
  background: linear-gradient(90deg, transparent, rgba(255, 123, 41, 0.34), transparent);
}

.sp-account-modal {
  width: min(92vw, 760px);
  max-width: 760px;
  max-height: min(88vh, 820px);
  background:
    radial-gradient(circle at top right, rgba(255, 123, 41, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(18, 10, 8, 0.985), rgba(9, 6, 6, 0.985));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--sp-text);
}

.sp-account-modal--profile {
  width: min(96vw, 1040px);
  max-width: 1040px;
  max-height: min(88vh, 780px);
  background:
    radial-gradient(circle at top right, rgba(255, 123, 41, 0.18), transparent 26%),
    radial-gradient(circle at top left, rgba(255, 215, 180, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(18, 11, 10, 0.99), rgba(10, 7, 8, 0.99));
  border-color: rgba(255, 179, 123, 0.16);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46), 0 0 0 1px rgba(255, 146, 84, 0.04);
  overflow-x: hidden;
  overflow-y: auto;
}

.sp-account-modal--profile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.03) 34%, rgba(255, 175, 116, 0.08) 52%, rgba(255, 255, 255, 0.02) 66%, transparent 100%);
  transform: translateX(-38%);
  opacity: 0.7;
}

.sp-account-modal--wide {
  width: min(94vw, 980px);
  max-width: 980px;
}

.sp-account-modal-header {
  background: rgba(17, 10, 8, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  align-items: flex-start;
}

.sp-account-modal--profile .sp-account-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 1.5rem 1.7rem 1.15rem;
  background:
    linear-gradient(180deg, rgba(22, 14, 12, 0.94), rgba(16, 11, 10, 0.82));
  backdrop-filter: blur(18px);
}

.sp-account-modal-header h2 {
  color: var(--sp-text);
}

.sp-account-modal-subtitle {
  margin: 0.3rem 0 0;
  color: var(--sp-text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.sp-account-modal--profile .sp-account-modal-subtitle {
  max-width: 64ch;
  color: #bba8b9;
}

.sp-account-modal .sp-modal-close {
  color: var(--sp-text-muted);
}

.sp-account-modal .sp-modal-close:hover {
  color: var(--sp-text);
  background: rgba(255, 255, 255, 0.06);
}

.sp-account-modal-body {
  text-align: left;
}

.sp-account-modal--profile .sp-account-modal-body {
  padding: 1.55rem 1.7rem 2rem;
}

.sp-account-profile-shell,
.sp-account-form {
  display: grid;
  gap: 1.1rem;
}

.sp-account-modal--profile .sp-account-profile-shell {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: start;
  gap: 1.2rem;
}

.sp-account-modal--profile #sp-account-profile-form {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-content: start;
}

.sp-account-profile-card {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.sp-account-modal--profile .sp-account-profile-card,
.sp-account-modal--profile #sp-account-profile-form {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1), transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-account-modal--profile.sp-modal--open .sp-account-profile-card,
.sp-account-modal--profile.sp-modal--open #sp-account-profile-form {
  opacity: 1;
  transform: translateY(0);
}

.sp-account-modal--profile.sp-modal--open .sp-account-profile-card:nth-child(1) {
  transition-delay: 0.03s;
}

.sp-account-modal--profile.sp-modal--open .sp-account-profile-card:nth-child(2) {
  transition-delay: 0.1s;
}

.sp-account-modal--profile.sp-modal--open #sp-account-profile-form {
  transition-delay: 0.16s;
}

.sp-account-modal--profile .sp-account-profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 1.3rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.018);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 40px rgba(0, 0, 0, 0.18);
}

.sp-account-modal--profile .sp-account-profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(255, 123, 41, 0.1), transparent 34%);
  opacity: 0.8;
}

.sp-account-profile-card--hero {
  background:
    radial-gradient(circle at top right, rgba(255, 123, 41, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018));
}

.sp-account-modal--profile .sp-account-profile-card--hero {
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(255, 123, 41, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
}

.sp-account-modal--profile .sp-account-profile-card--hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -42% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 123, 41, 0.16), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}

.sp-account-section-heading {
  display: grid;
  gap: 0.25rem;
}

.sp-account-section-eyebrow {
  color: #c7adc5;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sp-account-section-heading h3,
.sp-account-avatar-copy h3 {
  margin: 0;
  color: #fff;
  font-size: 1.08rem;
}

.sp-account-modal--profile .sp-account-section-heading h3,
.sp-account-modal--profile .sp-account-avatar-copy h3 {
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}

.sp-account-section-heading p,
.sp-account-avatar-copy p {
  margin: 0;
  color: var(--sp-text-muted);
  line-height: 1.6;
}

.sp-account-avatar-panel {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.sp-account-modal--profile .sp-account-avatar-panel {
  position: relative;
  z-index: 1;
  align-items: flex-start;
  gap: 1.35rem;
}

.sp-account-avatar-preview {
  width: 104px;
  height: 104px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #050505;
  border: 2px solid #ff7b29;
  color: #ffb172;
  font-size: 1.7rem;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(255, 123, 41, 0.18);
}

.sp-account-modal--profile .sp-account-avatar-preview {
  width: 122px;
  height: 122px;
  border-width: 3px;
  flex: 0 0 auto;
  box-shadow:
    0 22px 42px rgba(255, 123, 41, 0.22),
    0 0 0 8px rgba(255, 123, 41, 0.05);
}

.sp-account-modal--profile .sp-account-avatar-preview img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.sp-account-avatar-copy {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.sp-account-modal--profile .sp-account-avatar-copy {
  max-width: 56ch;
}

.sp-user-avatar img,
.sp-account-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sp-account-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.sp-account-modal--profile .sp-account-avatar-actions {
  margin-top: 0.15rem;
}

.sp-account-modal--profile .sp-account-avatar-actions .sp-btn {
  min-height: 42px;
  padding-inline: 1rem;
}

.sp-account-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.sp-account-modal--profile .sp-account-details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.sp-account-details-grid--billing {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sp-account-stat-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 0.35rem;
}

.sp-account-modal--profile .sp-account-stat-card {
  min-height: 104px;
  align-content: end;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.014)),
    rgba(255, 255, 255, 0.016);
  border-color: rgba(255, 255, 255, 0.07);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.sp-account-modal--profile .sp-account-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 176, 126, 0.18);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16);
}

.sp-account-stat-card--wide {
  grid-column: 1 / -1;
}

.sp-account-stat-label {
  color: var(--sp-text-muted);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sp-account-modal--profile .sp-account-stat-label {
  color: #bdaab8;
}

.sp-account-stat-card strong {
  color: var(--sp-text);
  font-size: 1.04rem;
  text-transform: capitalize;
}

.sp-account-modal--profile .sp-account-stat-card strong {
  font-size: 1.15rem;
}

.sp-account-checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sp-account-checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.sp-account-billing-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.sp-account-billing-table {
  width: 100%;
  border-collapse: collapse;
}

.sp-account-billing-table th,
.sp-account-billing-table td {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.sp-account-billing-table th {
  color: #ffcfaa;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sp-account-empty-row {
  color: var(--sp-text-muted);
  text-align: center;
}

.sp-account-footnote,
.sp-account-inline-status {
  color: var(--sp-text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.sp-account-footnote {
  color: #aa9bab;
}

.sp-account-profile-form-card {
  gap: 1rem;
}

.sp-account-modal--profile .sp-account-profile-form-card {
  min-height: 100%;
  align-content: start;
}

.sp-account-modal--profile .sp-form-field {
  gap: 0.45rem;
}

.sp-account-modal--profile .sp-form-field input {
  min-height: 56px;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.sp-account-modal--profile .sp-form-field input:focus {
  border-color: rgba(255, 151, 87, 0.4);
  box-shadow: 0 0 0 4px rgba(255, 123, 41, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.sp-account-profile-form-card input[readonly] {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

.sp-account-inline-status[data-state="success"] {
  color: #9ce0a5;
}

.sp-account-inline-status[data-state="error"] {
  color: #ffb0a3;
}

.sp-account-actions-row {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-end;
}

.sp-account-modal--profile .sp-account-actions-row {
  margin-top: auto;
  padding-top: 1.15rem;
}

.sp-account-modal--profile .sp-account-actions-row .sp-btn {
  min-width: 138px;
  min-height: 46px;
}

@media (max-width: 900px) {
  .sp-account-details-grid,
  .sp-account-details-grid--billing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sp-account-modal--profile {
    width: min(96vw, 96vw);
  }

  .sp-account-modal--profile .sp-account-profile-shell {
    grid-template-columns: 1fr;
  }

  .sp-account-modal--profile #sp-account-profile-form {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .sp-account-modal,
  .sp-account-modal--wide {
    width: min(96vw, 96vw);
  }

  .sp-account-avatar-panel,
  .sp-topbar-right {
    flex-wrap: wrap;
  }

  .sp-account-profile-card {
    padding: 1rem;
  }

  .sp-account-modal--profile .sp-account-modal-body {
    padding: 1.15rem;
  }

  .sp-account-actions-row {
    justify-content: stretch;
  }

  .sp-account-actions-row > .sp-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  .sp-account-menu {
    width: min(94vw, 320px);
    right: -0.25rem;
  }

  .sp-account-details-grid,
  .sp-account-details-grid--billing {
    grid-template-columns: 1fr;
  }

  .sp-account-avatar-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .sp-account-avatar-preview {
    width: 96px;
    height: 96px;
  }

  .sp-account-modal--profile .sp-account-avatar-preview {
    width: 108px;
    height: 108px;
  }
}

@media (max-height: 860px) {
  .sp-account-modal--profile {
    max-height: min(90vh, 720px);
  }

  .sp-account-modal--profile .sp-account-profile-shell {
    grid-template-columns: 1fr;
  }

  .sp-account-modal--profile #sp-account-profile-form {
    grid-column: auto;
    grid-row: auto;
  }

  .sp-account-modal--profile .sp-account-profile-card,
  .sp-account-modal--profile .sp-account-profile-form-card {
    padding: 1.1rem;
  }

  .sp-account-modal--profile .sp-account-avatar-preview {
    width: 108px;
    height: 108px;
  }

  .sp-account-modal--profile .sp-account-stat-card {
    min-height: 92px;
  }
}