.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  align-items: start;
  gap: 45px;
}

.profile-form {
  padding: 36px;
  color: var(--ink);
  border-radius: 24px;
  background: #fff;
}

.profile-form > label,
.profile-form-grid label {
  margin-bottom: 22px;
  display: grid;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 850;
}

.profile-form input,
.profile-form textarea {
  width: 100%;
  padding: 14px 15px;
  color: var(--ink);
  border: 1px solid #cfd8df;
  border-radius: 11px;
  background: #fff;
  outline: none;
}

.profile-form input:focus,
.profile-form textarea:focus {
  border-color: var(--mint-dark);
  box-shadow: 0 0 0 4px rgba(36, 185, 154, 0.11);
}

.profile-form input:disabled {
  color: #647481;
  background: #edf2f3;
  cursor: not-allowed;
}

.profile-form small {
  color: #71818e;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.username-input-shell {
  display: flex;
  align-items: center;
  border: 1px solid #cfd8df;
  border-radius: 11px;
  background: #fff;
}

.username-input-shell > span {
  padding-left: 15px;
  color: var(--mint-dark);
  font-weight: 900;
}

.username-input-shell input {
  border: 0;
  box-shadow: none !important;
}

.profile-photo-section {
  margin-bottom: 35px;
  padding-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #dde4e8;
}

.profile-avatar-preview,
.profile-preview-avatar,
.public-author-avatar {
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #07111f;
  border-radius: 24px;
  background: var(--mint);
  font-weight: 900;
}

.profile-avatar-preview {
  width: 105px;
  height: 105px;
  font-size: 1.5rem;
}

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

.profile-photo-button {
  padding: 11px 17px;
  display: inline-flex;
  color: #07111f;
  border-radius: 999px;
  background: var(--mint);
  font-weight: 900;
  cursor: pointer;
}

.profile-photo-section p {
  margin: 10px 0 0;
  color: #71818e;
  font-size: 0.8rem;
}

.profile-url-preview {
  margin: 15px 0 30px;
  padding: 18px;
  display: grid;
  gap: 5px;
  border-radius: 14px;
  background: #edf8f5;
}

.profile-url-preview span {
  color: #71818e;
  font-size: 0.78rem;
}

.profile-url-preview strong {
  overflow-wrap: anywhere;
  color: var(--mint-dark);
}

.profile-preview-panel {
  position: sticky;
  top: 110px;
}

.profile-preview-card {
  padding: 32px;
  border: 1px solid var(--portal-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
}

.profile-preview-avatar {
  width: 92px;
  height: 92px;
  margin-bottom: 25px;
  font-size: 1.4rem;
}

.profile-preview-card h2 {
  margin-bottom: 8px;
  color: #fff;
}

.profile-preview-card > strong {
  display: block;
  color: var(--mint);
}

.profile-preview-card > span {
  margin-top: 6px;
  display: block;
  color: #8fa0af;
}

.profile-preview-card p {
  margin-top: 20px;
  color: #a7b5c1;
}

.public-author-hero {
  padding: 115px 0;
}

.author-profile-container {
  max-width: 940px;
}

#author-profile-content {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: start;
  gap: 55px;
}

.public-author-avatar {
  width: 180px;
  height: 180px;
  border-radius: 40px;
  font-size: 2.3rem;
}

#author-profile-content h1 {
  margin-bottom: 12px;
  color: #fff;
  font-size: clamp(3.2rem, 7vw, 6.3rem);
}

#author-profile-headline {
  display: block;
  color: var(--mint);
  font-size: 1.25rem;
}

#author-profile-organization {
  margin-top: 7px;
  display: block;
  color: #92a4b5;
}

#author-profile-bio {
  max-width: 720px;
  margin-top: 28px;
  color: #b8c5d1;
  font-size: 1.08rem;
  line-height: 1.8;
}

.author-profile-links {
  margin-top: 25px;
}

.author-profile-links a {
  color: var(--mint);
  font-weight: 900;
}

.author-profile-loading,
.author-profile-error {
  color: #fff;
}

.author-article-empty {
  padding: 45px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

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

  .profile-preview-panel {
    position: static;
  }

  #author-profile-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-form {
    padding: 24px;
  }

  .profile-photo-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-author-avatar {
    width: 130px;
    height: 130px;
    border-radius: 30px;
  }
}

/* Remove mint background behind uploaded profile photos */

.profile-avatar-preview:has(img:not([hidden])),
.profile-preview-avatar:has(img:not([hidden])),
.public-author-avatar:has(img:not([hidden])) {
  background: transparent;
  box-shadow: none;
}

.profile-avatar-preview img,
.profile-preview-avatar img,
.public-author-avatar img {
  border-radius: inherit;
  background: transparent;
}

/* Improve profile image rendering */
.profile-avatar-preview img,
.profile-preview-avatar img,
.public-author-avatar img {
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
}

