.profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 20px 8px;
}

.profile-top__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-top__avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.profile-top__name {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 5.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #111;
  text-wrap: balance;
}

.profile-top__meta {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 550;
  color: #8a8a8a;
  font-variant-numeric: tabular-nums;
}

.profile-top__edit {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition-property: transform, background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.profile-top__edit:active {
  transform: scale(0.96);
}

.profile-main {
  padding-top: 18px;
}

.profile-bonus {
  margin-bottom: 14px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: #111;
  color: #fff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

.profile-bonus__label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.profile-bonus__value {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.profile-bonus__value--soon {
  max-width: 16ch;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-variant-numeric: normal;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.92);
}

.profile-bonus__hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.58);
  text-wrap: pretty;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 78px;
  padding: 14px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  text-align: center;
}

.profile-stat strong {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #111;
}

.profile-stat span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a8a8a;
}

.profile-block {
  margin-bottom: 20px;
}

.profile-block__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.profile-list {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition-property: background-color, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.profile-row:last-child {
  border-bottom: 0;
}

.profile-row:active {
  background: #f7f7f7;
}

.profile-row__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f3f3f3;
  color: #111;
}

.profile-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.profile-row__label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-row__desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 500;
  color: #8a8a8a;
}

.profile-row__chevron {
  flex-shrink: 0;
  color: #b0b0b0;
  font-size: 1.35rem;
  line-height: 1;
}

.profile-switch {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #ddd;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}

.profile-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease-out;
}

.profile-switch:checked {
  background: #111;
}

.profile-switch:checked::after {
  transform: translateX(18px);
}

.profile-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 8px 0 24px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  transition-property: transform, background-color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.profile-logout[hidden] {
  display: none !important;
}

.profile-logout:active {
  transform: scale(0.98);
}

.profile-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 60;
  translate: -50% 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

.profile-toast.is-visible {
  opacity: 1;
}

.modal__sheet--orders {
  padding: 0;
}

.orders-sheet {
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
}

.orders-sheet__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.orders-sheet__title {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
  text-wrap: balance;
}

.orders-sheet__subtitle {
  margin: 0 0 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #8a8a8a;
  text-wrap: pretty;
}

.orders-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52dvh, 420px);
  overflow: auto;
  padding-right: 2px;
}

.orders-card {
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: #f6f4f1;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.orders-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.orders-card__date {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: #111;
}

.orders-card__total {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #111;
}

.orders-card__meta {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 550;
  color: #8a8a8a;
}

.orders-card__items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orders-card__items li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 550;
  color: #3a3a3a;
}

.orders-card__items span:last-child {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: #111;
  font-weight: 700;
}

.orders-sheet__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 18px;
  border-radius: 20px;
  background: #f6f4f1;
}

.orders-sheet__empty[hidden] {
  display: none !important;
}

.orders-sheet__empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #111;
}

.orders-sheet__empty-text {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  color: #8a8a8a;
  text-wrap: pretty;
}

.orders-sheet__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.orders-sheet__cta:active {
  transform: scale(0.97);
}

@media (min-width: 900px) {
  .profile-toast {
    bottom: 24px;
  }
}
