.cm-account-profile {
  max-width: 1080px;
  min-width: 0;
  margin-inline: auto;
}

.cm-account-profile h1 {
  margin: 0 0 clamp(16px, 2.8vw, 24px);
  font-size: clamp(24px, 5vw, 31px);
  line-height: 1.25;
  letter-spacing: -.035em;
}

.cm-account-identity {
  padding-inline: clamp(15px, 3vw, 27px);
  background-image: radial-gradient(ellipse at 2% 0, var(--accent-soft), transparent 66%);
}

.cm-account-identity-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'avatar name proof' 'avatar facts proof';
  align-items: start;
  gap: 7px clamp(11px, 2.4vw, 20px);
  padding-block: clamp(16px, 3vw, 25px) 18px;
  min-width: 0;
}

.cm-account-identity .avatar.cm-account-portrait {
  grid-area: avatar;
  width: clamp(58px, 10vw, 87px);
  height: auto;
  aspect-ratio: 1;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.cm-account-identity-copy {
  grid-area: name;
  min-width: 0;
}

.cm-account-identity-copy h2 {
  margin: 0;
  font-size: clamp(20px, 4vw, 29px);
  line-height: 1.25;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}

.cm-account-identity-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.cm-account-tag, .cm-account-clan {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 40px;
  padding: 4px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-align: left;
  overflow-wrap: anywhere;
}

.cm-account-tag {
  margin-left: -7px;
}

.cm-account-tag:hover, .cm-account-clan:hover {
  background: var(--soft);
  color: var(--text);
}

.cm-account-copy-icon {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
}

.cm-account-copy-icon::before, .cm-account-copy-icon::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.cm-account-copy-icon::before { inset: 0 auto auto 0; }
.cm-account-copy-icon::after { inset: auto 0 0 auto; background: var(--card); }

.cm-account-facts {
  grid-area: facts;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

.cm-account-facts .member-league {
  min-width: 0;
  max-width: 100%;
  gap: 7px;
}

.cm-account-facts .member-league > div {
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.cm-account-facts .member-league > .l78-league-label,
.cm-account-facts .member-league:not(.l78-account-league) > div > span {
  display: none;
}

.cm-account-facts .connected-league-icon {
  display: grid;
  width: 27px;
  height: 31px;
}

.cm-account-facts .member-league strong {
  color: var(--text);
  font-size: 13px;
}

.cm-account-th, .cm-account-proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.cm-account-proof {
  grid-area: proof;
  align-self: start;
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
}

.cm-account-proof.verified {
  background: var(--accent-soft);
  color: var(--accent);
}

.cm-account-proof.pending {
  background: color-mix(in srgb, var(--gold) 14%, var(--card));
  color: var(--gold);
}

.cm-account-proof svg, .cm-account-clan > svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.cm-account-identity-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding-block: 11px;
  border-top: 1px solid var(--line);
}

.cm-account-clan {
  min-height: 44px;
  margin-left: -7px;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.cm-account-clan .connected-clan-identity {
  color: var(--text);
  font-weight: 650;
  gap: 6px;
}

.cm-account-clan :is(.connected-crest, .clan-symbol) {
  flex: none;
  width: 22px;
  height: 25px;
  font-size: 13px;
}

.cm-account-role::before {
  content: '·';
  margin-inline-end: 7px;
}

.cm-account-empty-clan {
  color: var(--muted);
  font-size: 12px;
  padding-block: 10px;
}

.cm-account-identity-foot .cm-account-player-link {
  flex: none;
  min-height: 44px;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  white-space: normal;
}

.cm-account-player-link svg, .cm-account-action svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.cm-account-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 295px), 1fr));
  align-items: start;
  gap: 14px;
  margin-top: 14px;
}

.cm-account-settings .cm-account-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 65px;
  padding: 12px 15px;
  list-style: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.cm-account-settings > details + .cm-account-row {
  border-top: 1px solid var(--line);
}

.cm-account-row::-webkit-details-marker { display: none; }
.cm-account-row:hover { background: var(--soft); }
.cm-account-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.cm-account-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.cm-account-icon svg { width: 17px; height: 17px; }
.cm-account-chevron { color: var(--muted); }
.cm-account-chevron svg, .cm-account-choice > svg { display: block; width: 16px; height: 16px; }
.cm-account-settings details[open] > summary .cm-account-chevron { transform: rotate(90deg); }

.cm-account-row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  overflow-wrap: anywhere;
}

.cm-account-row-copy strong { font-size: 13px; font-weight: 700; line-height: 1.35; }
.cm-account-row-copy small { color: var(--muted); font-size: 11px; line-height: 1.4; }

.cm-account-panel-body {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 0 15px 13px;
}

.cm-account-settings details:not([open]) > .cm-account-panel-body { display: none; }

.cm-account-choice, .cm-account-settings .cm-account-action {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  color: var(--text);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cm-account-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  font: inherit;
}

.cm-account-choice[aria-current='true'] {
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 1;
}

.cm-account-current { font-size: 10px; }
.cm-account-choice .avatar.player-avatar { width: 32px; height: 34px; min-width: 32px; }
.cm-account-settings .cm-account-action { justify-content: flex-start; font-size: 12px; }
.cm-account-settings .cm-account-delete { color: var(--metric-rose); background: transparent; }

@media (max-width: 520px) {
  .cm-account-identity-top {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: 'avatar name' 'facts facts' 'proof proof';
    align-items: center;
    row-gap: 8px;
  }

  .cm-account-proof { justify-self: start; }
  .cm-account-identity-foot { align-items: stretch; flex-direction: column; }
  .cm-account-identity-foot .cm-account-player-link { justify-content: space-between; }
  .cm-account-settings-grid { gap: 10px; margin-top: 11px; }
}
