.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: clamp(18px, 2.5vw, 27px);
  margin-block-end: 16px;
  border-radius: 15px;
  background: linear-gradient(113deg, #2e2051, #463276);
  color: #fbf7ff;
  min-width: 0;
}

.profile-avatar .avatar {
  width: 63px;
  height: 63px;
  font-size: 1.42rem;
  border: 1px solid #dcc9ff85;
  background: #efe5ff;
  color: #402579;
  border-radius: 14px;
}

.profile-hero-identity {
  min-width: 0;
}

.profile-hero-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-hero-identity h2 {
  margin-block: 6px 2px;
  font-weight: 730;
  font-size: clamp(1.36rem, 2.2vw, 1.88rem);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

[dir="rtl"] .profile-hero-identity h2 { letter-spacing: 0; }

.profile-hero-identity p {
  font-size: .88rem;
  color: #e4d9f8;
  overflow-wrap: anywhere;
}

.profile-hero-identity p bdi {
  display: inline-block;
  font-weight: 660;
  margin-inline-start: 5px;
  color: #fbf7ff;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(310px, .92fr);
  gap: 15px;
  align-items: start;
}

.profile-stack {
  display: grid;
  gap: 15px;
}

.profile-panel {
  padding: 16px 17px 18px;
}

.profile-panel-head {
  margin-block-end: 14px;
}

.profile-panel-head h2 {
  font-size: 1.08rem;
  font-weight: 725;
  line-height: 1.3;
}

.profile-panel-head p {
  margin-block-start: 4px;
  color: var(--muted);
  font-size: .83rem;
}

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

.profile-toggles {
  display: grid;
  gap: 7px;
}

.profile-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
  padding: 9px 10px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.profile-toggle input {
  position: absolute;
  inset-inline-end: 16px;
  width: 26px;
  height: 20px;
  margin: 0;
  opacity: 0;
}

.profile-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-toggle-copy strong {
  font-size: .86rem;
  font-weight: 660;
}

.profile-toggle-copy small {
  color: var(--muted);
  font-size: .78rem;
}

.profile-toggle-track {
  position: relative;
  pointer-events: none;
  display: block;
  flex: none;
  width: 36px;
  height: 22px;
  border: 1px solid var(--line);
  background: var(--faint);
  border-radius: 18px;
}

.profile-toggle-track::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  inset-block-start: 3px;
  width: 14px;
  height: 14px;
  background: var(--muted);
  border-radius: 50%;
}

.profile-toggle input:checked ~ .profile-toggle-track {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.profile-toggle input:checked ~ .profile-toggle-track::before {
  inset-inline-start: 17px;
  background: #fff;
}

[data-theme="dark"] .profile-toggle input:checked ~ .profile-toggle-track::before {
  background: #291747;
}

.profile-toggle input:focus-visible ~ .profile-toggle-track {
  outline: 3px solid #8e6eeb;
  outline-offset: 3px;
}

.profile-form-actions,
.profile-security-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-session-count {
  margin-block-end: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 590;
}

.profile-session-list {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.profile-session {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
}

.profile-session-head,
.profile-session-device {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.profile-session-device {
  flex-wrap: wrap;
}

.profile-session-device strong {
  font-size: .91rem;
  overflow-wrap: anywhere;
}

.profile-session-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 9px;
}

.profile-session-dates:empty {
  display: none;
}

.profile-session-dates dt {
  color: var(--muted);
  font-size: .74rem;
}

.profile-session-dates dd {
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.profile-session-action .button {
  min-height: 34px;
  padding: 5px 8px;
  font-size: .8rem;
}

.profile-session-footer {
  margin-block-start: 11px;
}

.profile-note {
  color: var(--muted);
  font-size: .91rem;
}

.profile-team-identity {
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile-team-identity p {
  display: grid;
  min-width: 0;
  gap: 1px;
  overflow-wrap: anywhere;
}

.profile-team-identity bdi {
  color: var(--muted);
  font-size: .8rem;
}

@media (max-width: 1080px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 500px) {
  .profile-panel {
    padding: 13px;
  }

  .profile-hero {
    gap: 12px;
  }

  .profile-avatar .avatar {
    width: 49px;
    height: 49px;
    font-size: 1.13rem;
  }

  .profile-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="off"]) .profile-toggle-track {
    transition: background-color var(--motion-quick, 130ms) ease, border-color var(--motion-quick, 130ms) ease;
  }

  :root:not([data-motion="off"]) .profile-toggle-track::before {
    transition: inset-inline-start var(--motion-ui, 220ms) var(--motion-in, ease),
      background-color var(--motion-quick, 130ms) ease;
  }
}
