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

.profile-editor-main {
  display: grid;
  gap: 22px;
}

.profile-settings-form,
.profile-link-form {
  display: grid;
  gap: 20px;
}

.profile-link-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.profile-editor-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-editor-section-heading h2,
.profile-editor-section-heading h3,
.profile-editor-section-heading p {
  margin: 0;
}

.profile-slug-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.profile-slug-field span {
  padding: 10px 0 10px 12px;
  color: var(--muted);
  white-space: nowrap;
}

.profile-slug-field input {
  border: 0;
  border-radius: 0;
  min-width: 0;
  padding-left: 2px;
}

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

.profile-color-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .82rem;
}

.profile-color-grid input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 3px;
}

.profile-image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.profile-upload-preview {
  display: block;
  width: 100%;
  max-height: 180px;
  margin: 8px 0;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.profile-upload-preview.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
}

.profile-editor-link-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.profile-editor-link-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.profile-editor-link-row.dragging {
  opacity: .45;
}

.profile-editor-link-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.profile-drag-handle,
.profile-link-row-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
}

.profile-link-row-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.profile-check input {
  width: auto;
}

.profile-editor-preview-column {
  min-width: 0;
}

.profile-preview-sticky {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 16px;
}

.profile-phone-preview {
  padding: 10px;
  border: 7px solid #26211e;
  border-radius: 38px;
  background: #26211e;
  box-shadow: 0 18px 45px rgba(42, 30, 20, .16);
}

.profile-share-panel {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.profile-share-panel code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-share-panel img {
  width: 160px;
  height: 160px;
}

.profile-analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.profile-analytics-grid div {
  padding: 16px 10px;
  border-radius: 14px;
  background: var(--surface-soft);
  text-align: center;
}

.profile-analytics-grid strong {
  display: block;
  font-size: 1.65rem;
}

.profile-analytics-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
}

.profile-public-body {
  margin: 0;
  min-height: 100vh;
  background: #efeae4;
}

.profile-public-page {
  min-height: 100vh;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 24px 12px 40px;
}

.profile-public-card {
  --profile-bg: #f4eee5;
  --profile-text: #2e2925;
  --profile-button: #fff;
  --profile-button-text: #2e2925;
  --profile-bg-image: none;
  width: min(100%, 520px);
  min-height: calc(100vh - 80px);
  color: var(--profile-text);
  background-color: var(--profile-bg);
  background-image: linear-gradient(rgba(255,255,255,.06), rgba(255,255,255,.06)), var(--profile-bg-image);
  background-size: cover;
  background-position: center;
  border-radius: 28px;
  box-shadow: 0 18px 55px rgba(36, 28, 22, .14);
  overflow: hidden;
}

.profile-public-card.compact {
  min-height: 620px;
  border-radius: 25px;
}

.profile-public-surface {
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.3));
}

.profile-public-card.compact .profile-public-surface {
  padding: 34px 17px 24px;
}

.profile-public-card.font-sans {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
}

.profile-public-card.font-serif {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.profile-public-card.font-rounded {
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
}

.profile-public-avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.86);
  box-shadow: 0 8px 24px rgba(36, 28, 22, .15);
}

.profile-public-card.compact .profile-public-avatar {
  width: 86px;
  height: 86px;
}

.profile-public-avatar.placeholder {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.9);
  background: rgba(80,70,60,.28);
}

.profile-public-card h1 {
  margin: 18px 0 0;
  color: inherit;
  font-size: clamp(1.45rem, 5vw, 2rem);
  text-align: center;
}

.profile-public-card.compact h1 {
  font-size: 1.35rem;
}

.profile-public-bio {
  margin: 12px 0 0;
  white-space: pre-wrap;
  text-align: center;
  line-height: 1.75;
}

.profile-public-links {
  width: 100%;
  display: grid;
  gap: 13px;
  margin-top: 28px;
}

.profile-link-item {
  position: relative;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 14px;
  color: var(--profile-button-text);
  background: color-mix(in srgb, var(--profile-button) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--profile-button-text) 12%, transparent);
  box-shadow: 0 7px 18px rgba(36, 28, 22, .09);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.profile-link-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 25px rgba(36, 28, 22, .13);
}

.button-rounded .profile-link-item {
  border-radius: 17px;
}

.button-pill .profile-link-item {
  border-radius: 999px;
}

.button-square .profile-link-item {
  border-radius: 4px;
}

.profile-link-copy {
  min-width: 0;
  flex: 1;
}

.profile-link-copy strong,
.profile-link-copy small,
.profile-link-kicker {
  display: block;
}

.profile-link-copy strong {
  line-height: 1.35;
}

.profile-link-copy small {
  margin-top: 4px;
  opacity: .76;
  line-height: 1.45;
}

.profile-link-kicker {
  margin-bottom: 4px;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .09em;
  opacity: .65;
}

.profile-button-leading,
.profile-button-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.profile-button-leading {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--profile-button);
  background: var(--profile-button-text);
  font-size: .9rem;
}

.profile-button-arrow {
  font-size: 1.15rem;
}

.type-picture,
.type-video {
  display: block;
  padding: 0;
  overflow: hidden;
}

.button-pill .type-picture,
.button-pill .type-video {
  border-radius: 24px;
}

.button-square .type-picture,
.button-square .type-video {
  border-radius: 4px;
}

.profile-picture-media,
.profile-video-media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
}

.profile-picture-media {
  min-height: 168px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--profile-button-text) 72%, #94775f), color-mix(in srgb, var(--profile-button) 82%, #c9a77d));
}

.profile-picture-media > img,
.profile-video-media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-placeholder,
.profile-video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.75);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.profile-picture-shade,
.profile-video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(20,15,12,.84) 100%);
}

.profile-picture-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: block;
  padding: 48px 18px 17px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
}

.profile-picture-overlay .profile-link-kicker {
  opacity: .8;
}

.profile-video-media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #191919, #5d4b45);
}

.profile-video-shade {
  background: rgba(0,0,0,.24);
}

.profile-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding-left: 4px;
  border: 2px solid rgba(255,255,255,.86);
  border-radius: 50%;
  color: #fff;
  background: rgba(15,15,15,.68);
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  transform: translate(-50%, -50%);
}

.type-video > .profile-link-copy {
  display: block;
  padding: 13px 16px 15px;
}

.type-music {
  min-height: 88px;
  padding: 11px 13px;
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--profile-button) 96%, transparent), color-mix(in srgb, var(--profile-button-text) 7%, var(--profile-button)));
}

.profile-music-art,
.profile-shop-media {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--profile-button);
  background: var(--profile-button-text);
}

.profile-music-art {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  font-size: 1.65rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.profile-music-art img,
.profile-shop-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-music-content,
.profile-shop-content {
  min-width: 0;
  flex: 1;
}

.profile-music-progress {
  display: block;
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--profile-button-text) 16%, transparent);
}

.profile-music-progress i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--profile-button-text);
}

.profile-music-play {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding-left: 2px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--profile-button-text) 26%, transparent);
  border-radius: 50%;
  font-size: .75rem;
}

.type-text {
  min-height: 48px;
  padding: 7px 2px 9px;
  background: transparent;
  border-width: 0 0 1px;
  border-color: color-mix(in srgb, var(--profile-text) 38%, transparent);
  border-radius: 0 !important;
  box-shadow: none;
}

.type-text:hover {
  box-shadow: none;
}

.type-text .profile-link-copy strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.profile-text-arrow {
  font-size: 1.2rem;
}

.type-shop {
  min-height: 116px;
  align-items: stretch;
  padding: 10px;
}

.profile-shop-media {
  width: 96px;
  min-height: 94px;
  border-radius: 12px;
  font-size: 2rem;
}

.profile-shop-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 3px 3px 2px 0;
}

.profile-shop-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--profile-button);
  background: var(--profile-button-text);
  font-size: .72rem;
  font-weight: 800;
}

[data-profile-image-field].is-unused {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  opacity: .68;
}

.profile-public-empty {
  padding: 20px;
  text-align: center;
  opacity: .7;
}

.profile-share-button {
  margin-top: auto;
  padding-top: 30px;
  border: 0;
  color: inherit;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.profile-powered-by {
  margin: 18px 0 0;
  color: #6d655f;
  font-size: .78rem;
}

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

  .profile-editor-preview-column {
    order: -1;
  }

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

  .profile-phone-preview {
    width: min(100%, 390px);
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .profile-image-grid,
  .profile-analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-editor-link-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-link-row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .profile-link-row-actions button {
    flex: 1;
  }

  .profile-public-page {
    padding: 0;
  }

  .profile-public-card {
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}
