:root {
  --profile-accent: var(--skill-overall);
  --profile-ink: #20242b;
  --profile-muted: #666b72;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--profile-ink);
}

body[data-home-profile] { margin-left: var(--shell-inset, var(--shell-inset-default)); }

#main { min-height: 100vh; }

.profile-score-strip {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 13px;
  width: min(100%, 1120px);
  min-height: 147px;
  margin: 0 auto;
  padding: 18px clamp(24px, 3.65vw, 41px) 20px;
  border-bottom: 2px solid var(--profile-accent);
}

.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-avatar {
  width: 86px;
  height: 86px;
  border: 1px solid #d8d8d8;
  border-radius: 50%;
  background: linear-gradient(145deg, #f4eee9, #ded5cf) center/cover no-repeat;
  color: #8b654f;
  font: 600 22px/1 inherit;
  cursor: pointer;
  transition: box-shadow 180ms ease;
}
.profile-avatar.has-photo span { visibility: hidden; }
.profile-avatar:hover,
.profile-avatar:focus-visible { box-shadow: 0 0 0 5px rgba(185, 87, 50, .12); outline: none; }
.avatar-delete {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 26px;
  height: 26px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: var(--surface);
  color: #6b6b6b;
  font-size: 19px;
  line-height: 21px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease;
}
.profile-avatar-wrap:hover .avatar-delete,
.profile-avatar-wrap:focus-within .avatar-delete { opacity: 1; }

.profile-identity { flex: 1 1 185px; min-width: 150px; }
.profile-name-button {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--profile-ink);
  font-family: inherit;
  font-size: clamp(23px, 2.9vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}
.profile-name-button:focus-visible { outline: 2px solid var(--profile-accent); outline-offset: 4px; }
.edit-mark { color: #9a9a9a; font-size: 16px; }
.profile-subtitle { margin-top: 4px; color: var(--profile-muted); font-size: 12px; font-weight: 700; letter-spacing: 1.7px; }
.profile-name-input { box-sizing: border-box; width: 100%; max-width: 250px; border: 0; border-bottom: 2px solid var(--profile-accent); color: inherit; font-family: inherit; font-size: clamp(23px, 2.9vw, 28px); font-weight: 700; line-height: 1.15; outline: 0; }

.profile-scores { display: flex; flex: 0 1 auto; gap: 22px; margin-left: -18px; }
.profile-score-item { display: grid; justify-items: center; gap: 7px; color: #332c28; font-size: 13px; font-weight: 800; }
.profile-score-ring {
  --ring-color: var(--ink-faint);
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  box-sizing: border-box;
  border: 6px solid var(--ring-color);
  border-radius: 50%;
  color: var(--profile-ink);
  font-size: 26px;
  font-weight: 700;
  transition: box-shadow 180ms ease;
}
.profile-score-ring.speaking { --ring-color: var(--skill-speaking); }
.profile-score-ring.writing { --ring-color: var(--skill-writing); }
.profile-score-ring.reading { --ring-color: var(--skill-reading); }
.profile-score-ring.listening { --ring-color: var(--skill-listening); }
.profile-score-ring:hover,
.profile-score-ring:focus-visible { outline: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--ring-color) 18%, transparent); }

.overall-score {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 129px;
  height: 108px;
  box-sizing: border-box;
  margin-left: 15px;
  padding: 8px 8px 14px;
  border-radius: 12px 12px 38% 38%;
  background: var(--profile-accent);
  color: var(--surface);
  text-align: center;
  box-shadow: 0 4px 10px rgba(116, 45, 20, .18);
}
.overall-score span { align-self: end; font-size: 14px; font-weight: 700; letter-spacing: 0; }
.overall-score strong { align-self: start; font-size: 48px; font-weight: 700; line-height: 1.05; }
.overall-score:focus-visible { outline: 3px solid rgba(185, 87, 50, .32); outline-offset: 3px; }
.profile-error { position: absolute; right: 22px; bottom: 4px; margin: 0; color: #8d3d25; font-size: 11px; }

@media (max-width: 820px) {
  .profile-score-strip { gap: 18px; padding-inline: 24px; }
  .profile-avatar { width: 88px; height: 88px; font-size: 22px; }
  .profile-scores { gap: 12px; margin-left: 0; }
  .profile-score-ring { width: 58px; height: 58px; border-width: 4px; font-size: 22px; }
  .profile-score-item { font-size: 11px; }
  .overall-score { width: 94px; height: 92px; margin-left: 0; border-radius: 10px 10px 35% 35%; }
  .overall-score span { font-size: 11px; }
  .overall-score strong { font-size: 36px; }
}

@media (min-width: 769px) and (max-width: 1200px) {
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-score-strip { gap: 10px; padding-inline: 18px; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-avatar { width: 72px; height: 72px; font-size: 18px; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-identity { min-width: 112px; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-name-button,
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-name-input { font-size: 21px; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-scores { gap: 8px; margin-left: 0; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-score-ring { width: 52px; height: 52px; border-width: 4px; font-size: 20px; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .profile-score-item { font-size: 10px; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .overall-score { width: 86px; height: 82px; margin-left: 0; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .overall-score span { font-size: 10px; }
  body[data-home-profile][data-shell-layout-state="side-navigation"] .overall-score strong { font-size: 34px; }
}

@media (max-width: 768px) {
  body[data-home-profile] { margin-left: 5px; }
}

@media (max-width: 660px) {
  .profile-score-strip { display: grid; grid-template-columns: 72px minmax(0, 1fr) 76px; gap: 17px 16px; padding: 18px 18px 22px; }
  .profile-avatar { width: 72px; height: 72px; font-size: 18px; }
  .profile-identity { min-width: 0; }
  .profile-name-button, .profile-name-input { font-size: 21px; }
  .profile-scores { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: space-between; gap: 7px; }
  .profile-score-ring { width: 54px; height: 54px; font-size: 19px; }
  .overall-score { grid-column: 3; grid-row: 1; width: 76px; height: 70px; padding: 8px 5px; border-radius: 18px; }
  .overall-score strong { font-size: 24px; }
  .overall-score span { font-size: 9px; }
}

@media (max-width: 390px) {
  .profile-score-strip { column-gap: 13px; padding-inline: 12px; }
  .profile-score-item { font-size: 9px; }
  .profile-score-ring { width: 49px; height: 49px; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-avatar, .avatar-delete, .profile-score-ring { transition: none; }
}
