.profile-shell {
  padding-top: clamp(52px, 8vw, 94px);
  padding-bottom: 110px;
}

.profile-loading {
  min-height: 52vh;
  display: grid;
  align-content: center;
  max-width: 760px;
}

.profile-loading h1,
.profile-hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -.052em;
}

.profile-loading > p:last-child,
.profile-heading > div:last-child > p:last-child {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.profile-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.profile-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-size: 28px;
  font-weight: 760;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.profile-button:hover {
  border-color: var(--accent);
}

.profile-button:focus-visible,
.profile-panel a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.profile-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.profile-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.profile-editor {
  margin-top: 18px;
}

.profile-save-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-identity-note {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

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

.profile-form label {
  display: grid;
  gap: 8px;
}

.profile-form label > span {
  font-size: 12px;
  font-weight: 700;
}

.profile-form input,
.profile-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink);
  font: inherit;
}

.profile-form input {
  min-height: 46px;
  padding: 0 13px;
}

.profile-form textarea {
  min-height: 96px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.6;
}

.profile-form input:focus,
.profile-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}

.profile-form small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.profile-form-wide {
  grid-column: 1 / -1;
}

.profile-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.profile-stats article {
  min-width: 0;
  padding: 22px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.profile-stats article + article {
  border-left: 1px solid var(--line);
}

.profile-stats small,
.profile-details dt,
.profile-learning-item small {
  color: var(--muted);
  font-size: 11px;
}

.profile-stats strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.04em;
}

.profile-stats span {
  color: var(--muted);
  font-size: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 18px;
  margin-top: 18px;
}

.profile-panel {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.profile-panel h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -.03em;
}

.profile-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.profile-panel-head a,
.profile-empty a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.profile-learning-list {
  display: grid;
}

.profile-learning-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 22px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

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

.profile-learning-item strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.profile-learning-progress {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.profile-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.profile-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.profile-details {
  margin: 22px 0 0;
}

.profile-details > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.profile-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.profile-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.profile-account-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.profile-empty {
  padding: 28px 0 10px;
  color: var(--muted);
  line-height: 1.65;
}

.profile-empty strong {
  color: var(--ink);
}

.profile-empty p {
  margin: 6px 0 12px;
}

@media (max-width: 820px) {
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-stats article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .profile-stats article:nth-child(4) {
    border-top: 1px solid var(--line);
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-form {
    grid-template-columns: 1fr;
  }
  .profile-form-actions {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .profile-hero,
  .profile-heading {
    align-items: flex-start;
  }
  .profile-hero {
    flex-direction: column;
  }
  .profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 17px;
  }
  .profile-heading {
    gap: 14px;
  }
  .profile-heading h1 {
    font-size: 42px;
  }
  .profile-learning-item {
    grid-template-columns: 1fr;
    gap: 11px;
  }
}
