.social-popup {
  position: fixed;
  inset: auto 1rem calc(var(--site-footer-height, 3.5rem) + var(--site-footer-safe-area, 0px) + 0.75rem) auto;
  right: 1rem;
  bottom: calc(var(--site-footer-height, 3.5rem) + var(--site-footer-safe-area, 0px) + 0.75rem);
  z-index: 120;
  width: min(23.5rem, calc(100vw - 1.5rem));
  height: min(34rem, calc(100dvh - var(--site-footer-height, 3.5rem) - var(--site-footer-safe-area, 0px) - 1.5rem));
  max-height: min(34rem, calc(100dvh - var(--site-footer-height, 3.5rem) - var(--site-footer-safe-area, 0px) - 1.5rem));
  border: 1px solid #272727;
  border-radius: 0;
  margin: 0;
  padding: 0;
  background: #080808;
  color: #e7e7e7;
  box-shadow: none;
  display: none;
  overflow: hidden;
  pointer-events: auto;
  transform-origin: bottom right;
}

.social-popup::backdrop {
  background: rgba(0, 0, 0, 0.18);
}

.social-popup.open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.social-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 3rem;
  padding: 0 0.8rem;
  border-bottom: 1px solid #272727;
}

.social-head-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.social-thread-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.social-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.social-head-actions .social-open-all {
  white-space: nowrap;
}

.social-title {
  min-width: 0;
  overflow: hidden;
  color: #e0e0e0;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: lowercase;
  white-space: nowrap;
}

.social-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 22rem;
  overflow: hidden;
}

.social-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.social-thread-button,
.social-action,
.social-close,
.social-back {
  border: 1px solid #303030;
  border-radius: 0;
  background: transparent;
  color: #e0e0e0;
  font: inherit;
  font-size: 0.7rem;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.social-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
}

.social-back,
.social-close {
  min-height: 1.65rem;
  padding: 0.15rem 0.45rem;
}

.social-icon-button {
  width: 1.9rem;
  height: 1.9rem;
  min-height: 1.9rem;
  display: grid;
  place-items: center;
  padding: 0;
}

.social-dialog-close {
  font-size: 1.05rem;
  line-height: 1;
}

.social-control-icon {
  width: 1.05rem;
  height: 1.05rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-avatar-link {
  flex: 0 0 auto;
  display: inline-grid;
  color: inherit;
  text-decoration: none;
}

.social-avatar-link:focus-visible {
  outline: 2px solid #d8d8d8;
  outline-offset: 2px;
}

.social-profile-name {
  color: inherit;
  text-decoration: none;
}

a.social-profile-name:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

a.social-profile-name:focus-visible {
  outline: 2px solid #d8d8d8;
  outline-offset: 2px;
}

.social-avatar {
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #3a3a3a;
  border-radius: 0;
  background: #1a1a1a;
  color: #bdbdbd;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.social-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.social-thread-avatar {
  width: 2.1rem;
  height: 2.1rem;
}

.site-footer-link[data-social-button] {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.18rem;
}

.social-notification-badge {
  min-width: 1.15rem;
  height: 1rem;
  border: 1px solid #555;
  border-radius: 0;
  display: inline-grid;
  place-items: center;
  padding: 0 0.25rem;
  color: #f2f2f2;
  font-size: 0.62rem;
  line-height: 1;
}

.social-notification-badge[data-empty="true"] {
  visibility: hidden;
}

.social-thread-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.2rem 0.65rem;
  margin-bottom: 0.45rem;
  min-height: 2.85rem;
  padding: 0.5rem 0.6rem;
  text-align: left;
}

.social-thread-button.active,
.social-thread-button.unread,
.social-thread-button:hover:not(:disabled),
.social-friend-tile:hover:not(:disabled),
.social-action:hover:not(:disabled),
.social-close:hover:not(:disabled),
.social-back:hover:not(:disabled) {
  border-color: #555;
  color: #fff;
}

.social-thread-button.unread {
  border-color: #555;
  box-shadow: inset 0 0 0 1px rgba(242, 242, 242, 0.08);
}

.social-action:disabled,
.social-thread-mute:disabled {
  opacity: 0.42;
  cursor: default;
}

.social-thread-button:focus-visible,
.social-friend-tile:focus-visible,
.social-action:focus-visible,
.social-close:focus-visible,
.social-back:focus-visible,
.social-history-button:focus-visible,
.social-compose textarea:focus-visible,
.social-compose-music-remove:focus-visible,
.social-music-card:focus-visible {
  outline: 2px solid #d8d8d8;
  outline-offset: 2px;
}

.social-muted {
  color: #8b8b8b;
  font-size: 0.7rem;
  line-height: 1.4;
}

.social-section-label {
  color: #909090;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin: 0.25rem 0 0.1rem;
  text-transform: lowercase;
}

.social-thread-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-thread-preview {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #8b8b8b;
  font-size: 0.7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-thread-time {
  color: #909090;
  font-size: 0.65rem;
  white-space: nowrap;
}

.social-thread-muted {
  color: #929292;
  font-size: 0.62rem;
  white-space: nowrap;
}

.social-live-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-height: 500px) {
  .social-popup {
    max-height: calc(100dvh - var(--site-footer-height, 3.5rem) - var(--site-footer-safe-area, 0px) - 0.75rem);
  }

  .social-body {
    min-height: 0;
  }
}

.social-thread-meta {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.35rem;
  min-width: 0;
}

.social-thread-badge {
  min-width: 1rem;
  height: 1rem;
  border: 1px solid #555;
  border-radius: 0;
  display: inline-grid;
  place-items: center;
  padding: 0 0.25rem;
  color: #f2f2f2;
  font-size: 0.62rem;
  line-height: 1;
}

.social-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.7rem;
}

.social-empty {
  color: #8b8b8b;
  padding: 0.8rem 0.2rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.social-error {
  margin-bottom: 0.65rem;
  border-left: 2px solid #b86a6a;
  color: #e2a4a4;
  padding: 0.55rem 0.65rem;
  font-size: 0.75rem;
  line-height: 1.45;
}

.social-inbox {
  display: grid;
  gap: 0.15rem;
}

.social-item {
  display: grid;
  gap: 0.45rem;
  border-bottom: 1px solid #202020;
  padding: 0.75rem 0;
}

.social-item:first-child {
  padding-top: 0;
}

.social-message {
  display: grid;
  gap: 0.18rem;
  justify-items: start;
  margin-bottom: 0.7rem;
}

.social-message.mine {
  justify-items: end;
}

.social-message.system {
  justify-items: start;
}

.social-bubble {
  max-width: min(20rem, 86%);
  border: 1px solid #272727;
  border-radius: 0;
  background: #101010;
  padding: 0.45rem 0.55rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.social-message.mine .social-bubble {
  background: #1b1b1b;
  border-color: #3a3a3a;
}

.social-message.system .social-bubble {
  background: #121212;
  border-color: #333;
}

.social-music-card {
  width: min(20rem, 100%);
  min-width: 0;
  display: grid;
  grid-template-columns: 3.15rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid #343434;
  border-radius: 0;
  background: #101010;
  color: #dedede;
  padding: 0.48rem;
  text-decoration: none;
}

a.social-music-card:hover {
  border-color: #626262;
  background: #171717;
  color: #fff;
}

.social-music-card.is-unavailable {
  border-style: dashed;
  color: #999;
}

.social-music-card-cover {
  width: 3.15rem;
  aspect-ratio: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #303030;
  border-radius: 0;
  background: #1b1b1b;
  color: #909090;
  font-size: 1rem;
}

.social-music-card-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.social-music-card-copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.social-music-card-copy small {
  color: #818181;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.social-music-card-copy strong,
.social-music-card-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-music-card-copy strong {
  font-size: 0.75rem;
  font-weight: 600;
}

.social-music-card-copy > span {
  color: #909090;
  font-size: 0.64rem;
}

.social-music-card-open {
  color: #8f8f8f;
  font-size: 1.15rem;
}

.social-music-card.is-compact {
  grid-template-columns: 2.55rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.38rem;
}

.social-music-card.is-compact .social-music-card-cover {
  width: 2.55rem;
}

.social-message.mine .social-music-card {
  justify-self: end;
}

.social-seen-through-marker {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.social-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.65rem;
  border-top: 1px solid #272727;
}

.social-compose-music {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.4rem;
}

.social-compose-music .social-music-card {
  width: 100%;
}

.social-compose-music-remove {
  width: 1.8rem;
  height: 1.8rem;
  min-height: 1.8rem;
  display: grid;
  place-items: center;
  border: 1px solid #303030;
  border-radius: 0;
  background: #151515;
  color: #aaa;
  font: inherit;
  cursor: pointer;
}

.social-compose-music-remove:hover {
  border-color: #5a5a5a;
  color: #fff;
}

.social-compose-unavailable {
  border-top: 1px solid #272727;
  color: #8b8b8b;
  padding: 0.75rem;
  font-size: 0.72rem;
  line-height: 1.45;
}

.social-compose textarea {
  min-width: 0;
  min-height: 2.25rem;
  max-height: 7rem;
  border: 1px solid #272727;
  border-radius: 0;
  background: #0f0f0f;
  color: #e7e7e7;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.45rem 0.55rem;
  resize: vertical;
}

.social-friends {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #242424;
}

.social-share-picker,
.social-share-friends {
  display: grid;
  gap: 0.55rem;
}

.social-share-picker > .social-music-card {
  width: 100%;
}

.social-share-friends {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid #242424;
}

.social-friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr));
  gap: 0.45rem;
}

.social-friend-tile {
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.45rem;
  border: 1px solid #272727;
  border-radius: 0;
  background: transparent;
  color: #d8d8d8;
  font: inherit;
  padding: 0.55rem;
  cursor: pointer;
}

.social-friend-tile:disabled {
  cursor: default;
  opacity: 0.42;
}

.social-friend-avatar {
  width: 2.8rem;
  height: 2.8rem;
}

.social-friend-name {
  width: 100%;
  overflow: hidden;
  font-size: 0.7rem;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-blocked-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
}

.social-history-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #9b9b9b;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  padding: 0.35rem;
}

.social-history-button:hover:not(:disabled) {
  color: #fff;
}

.profile-actions .social-action {
  min-height: 2rem;
}

.profile-action-status {
  color: #a7a7a7;
  font-size: 0.72rem;
  line-height: 1.45;
}

.profile-action-status:empty {
  display: none;
}

.report-dialog {
  width: min(31rem, calc(100vw - 1.5rem));
  max-height: min(42rem, calc(100dvh - 1.5rem));
  overflow: auto;
  border: 1px solid #343434;
  border-radius: 0;
  margin: auto;
  padding: 0;
  background: #080808;
  color: #e5e5e5;
  box-shadow: none;
}

.report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.report-dialog-form {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.report-dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.report-dialog-heading h2 {
  margin: 0;
  color: #eee;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
}

.report-dialog-kicker {
  margin: 0 0 0.2rem;
  color: #8f8f8f;
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.report-dialog-close {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.report-dialog-copy {
  margin: 0;
  color: #999;
  font-size: 0.75rem;
  line-height: 1.5;
}

.report-dialog-field {
  display: grid;
  gap: 0.4rem;
  color: #bdbdbd;
  font-size: 0.72rem;
}

.report-dialog-field > span {
  font-weight: 500;
}

.report-dialog-field small {
  color: #949494;
  font-weight: 400;
}

.report-dialog select,
.report-dialog textarea {
  width: 100%;
  border: 1px solid #303030;
  border-radius: 0;
  background: #0b0b0b;
  color: #e6e6e6;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.55rem 0.6rem;
}

.report-dialog textarea {
  min-height: 6.5rem;
  resize: vertical;
  line-height: 1.45;
}

.report-dialog select:focus-visible,
.report-dialog textarea:focus-visible,
.report-dialog input:focus-visible {
  outline: 2px solid #d8d8d8;
  outline-offset: 2px;
}

.report-dialog-count {
  justify-self: end;
}

.report-dialog-block {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #b8b8b8;
  font-size: 0.74rem;
}

.report-dialog-block input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #aaa;
}

.report-dialog-error {
  margin: 0;
  border-left: 2px solid #b86a6a;
  color: #e2a4a4;
  padding: 0.5rem 0.6rem;
  font-size: 0.73rem;
  line-height: 1.45;
}

.report-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

.report-dialog-submit {
  border-color: #65413f;
  color: #e2b2ae;
}

.social-popup .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 620px) {
  .social-popup {
    inset: auto 0.65rem calc(var(--site-footer-height, 3.5rem) + var(--site-footer-safe-area, 0px) + 0.5rem);
    right: 0.65rem;
    left: 0.65rem;
    bottom: calc(var(--site-footer-height, 3.5rem) + var(--site-footer-safe-area, 0px) + 0.5rem);
    width: auto;
    max-width: none;
    height: min(34rem, calc(100dvh - var(--site-footer-height, 3.5rem) - var(--site-footer-safe-area, 0px) - 1rem));
    max-height: min(34rem, calc(100dvh - var(--site-footer-height, 3.5rem) - var(--site-footer-safe-area, 0px) - 1rem));
  }

  .social-body {
    min-height: min(25rem, calc(100dvh - var(--site-footer-height, 3.5rem) - var(--site-footer-safe-area, 0px) - 6rem));
  }

  .social-compose textarea {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .social-popup {
    inset: auto 0.5rem calc(var(--site-footer-height, 3.5rem) + var(--site-footer-safe-area, 0px) + 0.35rem);
    right: 0.5rem;
    left: 0.5rem;
    bottom: calc(var(--site-footer-height, 3.5rem) + var(--site-footer-safe-area, 0px) + 0.35rem);
  }

  .social-body {
    min-height: min(23.5rem, calc(100dvh - var(--site-footer-height, 3.5rem) - var(--site-footer-safe-area, 0px) - 5.5rem));
  }
}

/* Owner profile editor. Public/non-owner profile markup never receives its mount. */
.profile-editor-root {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #272727;
  color: #e7e7e7;
  font-size: 0.78rem;
}

.profile-music {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid #272727;
}

.profile-music-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.profile-music-grid.is-editing {
  padding-top: 2.15rem;
}

.profile-music-card-shell {
  position: relative;
  min-width: 0;
}

.profile-music-card-shell.is-controls-active,
.profile-music-card-shell.is-moving {
  z-index: 12;
}

.profile-music-card {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  height: 100%;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--profile-accent, #7c5cff) 32%, #303030);
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 6%, #111);
  color: #e7e7e7;
  padding: 0.45rem;
  text-decoration: none;
}

.profile-music-card:hover {
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 65%, #555);
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 11%, #121212);
  color: #fff;
}

.profile-music-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.profile-music-cover {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  overflow: hidden;
  background: #090909;
  color: #8b8b8b;
  font-size: 1.15rem;
}

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

.profile-music-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.profile-music-copy small {
  color: #8b8b8b;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-music-copy strong,
.profile-music-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-music-copy strong {
  margin-top: 0.1rem;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 600;
}

.profile-music-copy > span {
  margin-top: 0.15rem;
  color: #9a9a9a;
  font-size: 0.68rem;
}

.profile-music-open {
  color: #777;
  font-size: 1.15rem;
}

.profile-music-card-shell.is-moving .profile-music-card {
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 72%, #777);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--profile-accent, #7c5cff) 42%, transparent);
}

.profile-music-card-tools {
  bottom: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
}

.profile-music-picker {
  box-sizing: border-box;
  width: min(42rem, calc(100vw - 2rem));
  height: min(42rem, calc(100dvh - 2rem));
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 1px solid #373737;
  border-radius: 8px;
  margin: auto;
  padding: 0;
  background: #0e0e0e;
  color: #e7e7e7;
  box-shadow: 0 1.2rem 4rem rgba(0, 0, 0, 0.65);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.profile-music-picker[open] {
  display: grid;
}

.profile-music-picker::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.profile-music-picker-shell {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  padding: 1rem;
}

.profile-music-picker-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.profile-music-picker-heading p,
.profile-music-picker-heading h2,
.profile-music-picker-copy,
.profile-music-picker-empty {
  margin: 0;
}

.profile-music-picker-heading p {
  margin-bottom: 0.2rem;
  color: #858585;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.profile-music-picker-heading h2 {
  color: #f0f0f0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.profile-music-picker-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #969696;
  font-size: 0.7rem;
}

.profile-music-picker button {
  min-width: 0;
  min-height: 2.25rem;
  border: 1px solid #343434;
  border-radius: 0;
  background: #151515;
  color: #d8d8d8;
  cursor: pointer;
  font: inherit;
}

.profile-music-picker button:hover:not(:disabled) {
  border-color: #555;
  background: #1c1c1c;
  color: #fff;
}

.profile-music-picker button:focus-visible,
.profile-music-picker input:focus-visible {
  outline: 2px solid #f0f0f0;
  outline-offset: 2px;
}

.profile-music-picker button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.profile-music-picker-heading-actions button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.profile-music-picker-copy {
  color: #8e8e8e;
  font-size: 0.68rem;
}

.profile-music-picker-search input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.55rem;
  border: 1px solid #303030;
  border-radius: 0;
  background: #090909;
  color: #ededed;
  font: inherit;
  font-size: 0.76rem;
  padding: 0.5rem 0.65rem;
}

.profile-music-picker-search input::placeholder {
  color: #6f6f6f;
}

.profile-music-picker-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
}

.profile-music-picker-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.2rem;
  padding: 0.4rem 0.65rem;
  color: #939393;
  font-size: 0.69rem;
}

.profile-music-picker-tabs button span {
  color: #696969;
  font-size: 0.6rem;
}

.profile-music-picker-tabs button[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 65%, #555);
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 13%, #151515);
  color: #f1f1f1;
}

.profile-music-picker-results {
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #292929;
  background: #090909;
  overscroll-behavior: contain;
  scrollbar-color: #404040 #0a0a0a;
}

.profile-music-picker-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  border-bottom: 1px solid #242424;
  padding: 0.5rem 0.6rem;
}

.profile-music-picker-row:last-child {
  border-bottom: 0;
}

.profile-music-picker-row.is-selected {
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 9%, #0b0b0b);
}

.profile-music-picker-row.is-private {
  background: #0c0c0c;
}

.profile-music-picker-cover {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  background: #151515;
  color: #767676;
  font-size: 1rem;
}

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

.profile-music-picker-row-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.profile-music-picker-row-copy strong,
.profile-music-picker-row-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-music-picker-row-copy strong {
  color: #e5e5e5;
  font-size: 0.76rem;
  font-weight: 600;
}

.profile-music-picker-row-copy > span {
  color: #848484;
  font-size: 0.65rem;
}

.profile-music-picker .profile-music-picker-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-color: #414141;
  font-size: 1.05rem;
  line-height: 1;
}

.profile-music-picker-row.is-selected .profile-music-picker-toggle {
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 62%, #555);
  color: #fff;
}

.profile-music-picker-empty {
  display: grid;
  min-height: 8rem;
  place-items: center;
  color: #818181;
  font-size: 0.72rem;
  text-align: center;
  padding: 1rem;
}

.profile-music-picker-state {
  display: grid;
  place-items: center;
  gap: 0.65rem;
  min-height: 12rem;
  color: #969696;
  font-size: 0.74rem;
  text-align: center;
}

.profile-music-picker-state.is-error {
  color: #dda6a6;
}

.profile-music-picker-state button {
  padding: 0.4rem 0.7rem;
}

.profile-music-picker-footer {
  display: grid;
  gap: 0.25rem;
  min-height: 1.15rem;
  color: #858585;
  font-size: 0.64rem;
  line-height: 1.4;
}

.profile-music-picker-error {
  color: #dda6a6;
}

.profile-editor-root.mode-static {
  display: contents;
}

.profile-editor-root.mode-view {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.profile-editor-view > .profile-music + .profile-editor-canvas {
  margin-top: 1.35rem;
}

.profile-owner-toolbar,
.profile-editor-add {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-editor-root.mode-edit > .profile-owner-toolbar {
  position: sticky;
  z-index: 60;
  top: 0.35rem;
  border: 1px solid #292929;
  background: rgba(12, 12, 12, 0.94);
  box-shadow: 0 0.45rem 1.1rem rgba(0, 0, 0, 0.3);
  padding: 0.35rem;
  backdrop-filter: blur(10px);
}

.profile-owner-toolbar button,
.profile-editor-panel button,
.profile-editor-conflict button,
.profile-badge-popover button {
  min-height: 2.5rem;
  border: 1px solid #343434;
  border-radius: 0;
  background: #151515;
  color: #d8d8d8;
  font: inherit;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

[data-profile-editor-entry],
.profile-editor-entry {
  width: fit-content;
  max-width: 100%;
  margin-top: 0.55rem;
}

.profile-editor-entry-button {
  min-height: 2.1rem;
  border: 1px solid #343434;
  border-radius: 0;
  background: #151515;
  color: #d8d8d8;
  font: inherit;
  font-size: 0.72rem;
  padding: 0.32rem 0.55rem;
  cursor: pointer;
}

.identity > .profile-editor-entry-button {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.55rem;
}

.profile-editor-entry-button:hover:not(:disabled) {
  border-color: #606060;
  color: #fff;
}

.profile-editor-entry-button:focus-visible {
  outline: 2px solid #e0e0e0;
  outline-offset: 2px;
}

.profile-owner-toolbar button:hover:not(:disabled),
.profile-editor-panel button:hover:not(:disabled),
.profile-editor-conflict button:hover:not(:disabled),
.profile-badge-popover button:hover:not(:disabled) {
  border-color: #606060;
  color: #fff;
}

.profile-owner-toolbar button:focus-visible,
.profile-editor-panel button:focus-visible,
.profile-editor-conflict button:focus-visible,
.profile-editor-panel input:focus-visible,
.profile-editor-panel textarea:focus-visible,
.profile-editor-panel select:focus-visible,
.profile-badge-popover button:focus-visible {
  outline: 2px solid #e0e0e0;
  outline-offset: 2px;
}

.profile-owner-toolbar button:disabled,
.profile-editor-panel button:disabled,
.profile-editor-conflict button:disabled {
  opacity: 0.42;
  cursor: default;
}

.profile-owner-toolbar .profile-editor-save:not(:disabled) {
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 68%, #555);
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 18%, #151515);
  color: #fff;
}

.profile-editor-save-state {
  min-height: 1em;
  margin-left: auto;
  color: #8b8b8b;
  font-size: 0.7rem;
}

.profile-editor-save-state.is-dirty {
  color: #d6b77c;
}

.profile-editor-error,
.profile-editor-warning,
.profile-editor-conflict {
  margin: 0;
  border-left: 2px solid #565656;
  padding: 0.55rem 0.7rem;
  color: #bdbdbd;
  line-height: 1.5;
}

.profile-editor-error,
.profile-editor-conflict {
  border-color: #a15858;
  color: #e0aaaa;
}

.profile-editor-warning {
  border-color: #8a7542;
  color: #d3c28f;
}

.profile-editor-conflict {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.profile-editor-panel {
  display: grid;
  gap: 0.85rem;
}

.profile-editor-utility-row {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
}

.profile-editor-draft-head {
  min-width: 0;
  padding: 0.2rem 0 0.45rem;
}

.profile-editor-appearance {
  position: relative;
  width: fit-content;
}

.profile-editor-appearance > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 2.1rem;
  border: 1px solid #343434;
  background: #111;
  cursor: pointer;
  color: #cfcfcf;
  list-style: none;
  padding: 0.32rem 0.55rem;
}

.profile-editor-appearance > summary::-webkit-details-marker {
  display: none;
}

.profile-editor-appearance > summary::after {
  display: block;
  color: #8b8b8b;
  content: '›';
  transform: rotate(0deg);
  transition: transform 0.12s ease;
}

.profile-editor-appearance[open] > summary {
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 55%, #454545);
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 10%, #111);
}

.profile-editor-appearance[open] > summary::after {
  transform: rotate(90deg);
}

.profile-editor-appearance > summary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.profile-editor-appearance-menu {
  position: absolute;
  z-index: 22;
  top: calc(100% + 0.35rem);
  left: 0;
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 3.25rem;
  align-items: end;
  gap: 0.55rem;
  width: min(18rem, calc(100vw - 2rem));
  border: 1px solid #343434;
  background: #0d0d0d;
  padding: 0.55rem;
  box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.45);
}

.profile-editor-field,
.profile-editor-add label,
.profile-badge-popover label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.profile-editor-field > span,
.profile-editor-add label > span,
.profile-badge-popover label > span {
  color: #8b8b8b;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-editor-panel input,
.profile-editor-panel textarea,
.profile-editor-panel select,
.profile-badge-popover input {
  width: 100%;
  min-width: 0;
  border: 1px solid #343434;
  border-radius: 0;
  background: #0c0c0c;
  color: #e7e7e7;
  font: inherit;
  padding: 0.48rem 0.55rem;
}

.profile-editor-panel textarea {
  resize: vertical;
  line-height: 1.45;
}

.profile-editor-color input {
  min-height: 2.45rem;
  padding: 0.15rem;
}


.profile-editor-draft-head .avatar {
  overflow: visible;
}

.profile-editor-avatar-change,
.profile-editor-avatar-clear {
  position: absolute;
  z-index: 7;
  top: -0.45rem;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  min-width: 0;
  min-height: 0;
  border: 1px solid #454545;
  border-radius: 999px;
  background: #101010;
  color: #ddd;
  padding: 0;
  cursor: pointer;
}

.profile-editor-avatar-change {
  right: -0.45rem;
}

.profile-editor-avatar-clear {
  left: -0.45rem;
}

.profile-editor-avatar-change:focus-visible,
.profile-editor-avatar-clear:focus-visible,
.profile-editor-inline-status input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.profile-editor-draft-head .identity {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-editor-draft-head .identity > .profile-status {
  position: static;
  left: auto;
  bottom: auto;
  max-width: 100%;
  margin-top: 0.32rem;
  transform: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.profile-status.profile-editor-inline-status {
  display: inline-grid;
  grid-template-areas: "status";
  box-sizing: border-box;
  width: fit-content;
  min-width: 2.5rem;
  max-width: 100%;
  padding: 0;
  background: #0d0d0d;
  vertical-align: top;
}

.profile-editor-status-mirror,
.profile-editor-inline-status input {
  grid-area: status;
  box-sizing: border-box;
  min-width: 0;
  color: inherit;
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.25;
  padding: 0.27rem 0.45rem;
  white-space: pre;
}

.profile-editor-status-mirror {
  visibility: hidden;
}

.profile-editor-inline-status input {
  width: 100%;
  border: 0;
  background: transparent;
}

.profile-status.profile-editor-inline-status-value {
  display: block;
  width: fit-content;
  overflow-wrap: anywhere;
}

.profile-editor-visibility {
  width: fit-content;
  min-height: 2.1rem !important;
  padding: 0.32rem 0.55rem !important;
}

.profile-editor-add {
  position: relative;
  align-items: end;
  width: fit-content;
}

.profile-editor-panel .profile-editor-add-trigger {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  min-width: 0;
  min-height: 0;
  border-radius: 999px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.profile-editor-add-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  display: grid;
  width: max-content;
  min-width: 11rem;
  border: 1px solid #3a3a3a;
  background: #0d0d0d;
  box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.45);
  padding: 0.3rem;
}

.profile-editor-panel .profile-editor-add-menu button {
  min-height: 2.2rem;
  border: 0;
  background: transparent;
  text-align: left;
}

.profile-editor-panel .profile-editor-add-menu button:hover,
.profile-editor-panel .profile-editor-add-menu button:focus-visible {
  background: #1b1b1b;
}

.profile-editor-canvas {
  --profile-grid-gap: 0.5rem;
  --profile-grid-row: 2.75rem;
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: var(--profile-grid-row);
  gap: var(--profile-grid-gap);
  min-width: 0;
  min-height: var(--profile-grid-row);
  align-items: stretch;
}

.profile-editor-canvas.is-preview {
  --profile-grid-gap: 0.55rem;
  --profile-grid-row: 2rem;
}

.profile-editor-canvas.is-editing {
  margin-top: 1.5rem;
}

.profile-canvas-block {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid color-mix(in srgb, var(--profile-accent, #7c5cff) 38%, #303030);
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 5%, #121212);
  padding: 0;
  overflow: visible;
}

.profile-canvas-block-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0.7rem;
}

.profile-editor-canvas.is-preview .profile-canvas-block {
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 7%, #111);
}

.profile-editor-canvas.is-preview .profile-canvas-block-content {
  overflow: hidden;
  padding: 0.75rem;
}

.profile-editor-canvas.is-preview .profile-canvas-block.is-empty-badges {
  visibility: hidden;
  pointer-events: none;
}

.profile-editor-canvas.is-editing .profile-canvas-block.is-selected {
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 62%, #555);
}

.profile-editor-canvas.is-editing .profile-canvas-block.is-controls-active {
  z-index: 12;
}

.profile-canvas-block.is-invalid {
  border-color: #cf6868;
  background: rgba(105, 24, 24, 0.42);
  box-shadow: inset 0 0 0 1px #cf6868;
}

.profile-canvas-block-spacer {
  border-style: dashed;
  background: transparent;
}

.profile-editor-canvas.is-preview .profile-canvas-block-spacer {
  border-color: transparent;
}

.profile-box-tools {
  position: absolute;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  width: max-content;
  border: 1px solid #444;
  background: #101010;
  box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.5);
  padding: 0.12rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.profile-canvas-block-tools {
  bottom: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
}

.profile-canvas-block[data-profile-tools-align="left"] .profile-canvas-block-tools {
  right: auto;
  left: 0;
  transform: none;
}

.profile-canvas-block[data-profile-tools-align="right"] .profile-canvas-block-tools {
  right: 0;
  left: auto;
  transform: none;
}

.profile-box-tools button,
.profile-editor-canvas .profile-canvas-resize {
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: #cfcfcf;
  font: inherit;
  padding: 0;
  cursor: pointer;
  pointer-events: none;
  touch-action: none;
  user-select: none;
}

.profile-box-tools .profile-canvas-drag,
.profile-box-tools .profile-canvas-remove,
.profile-box-action-placeholder {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0 !important;
  background: transparent !important;
  padding: 0;
}

.profile-box-action-placeholder {
  pointer-events: none;
}

.profile-canvas-drag {
  cursor: grab;
}

.profile-canvas-drag:active {
  cursor: grabbing;
}

.profile-canvas-drag > span,
.profile-canvas-remove > span {
  position: relative;
  display: block;
  width: 0.72rem;
  height: 0.72rem;
}

.profile-canvas-drag > span::before,
.profile-canvas-remove > span::before,
.profile-canvas-remove > span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  content: '';
  transform-origin: center;
}

.profile-canvas-drag > span::before {
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 0.27rem currentColor,
    0 0.54rem currentColor,
    0.32rem 0 currentColor,
    0.32rem 0.27rem currentColor,
    0.32rem 0.54rem currentColor;
  transform: translate(calc(-50% - 0.16rem), calc(-50% - 0.27rem));
}

.profile-canvas-remove > span::before,
.profile-canvas-remove > span::after {
  width: 0.62rem;
  height: 1px;
  border-radius: 999px;
  background: currentColor;
}

.profile-canvas-remove > span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.profile-canvas-remove > span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.profile-editor-canvas .profile-canvas-resize {
  position: absolute;
  z-index: 6;
  margin: 0;
  opacity: 0;
  padding: 0;
  transition: opacity 0.12s ease;
}

.profile-editor-canvas.is-editing .profile-canvas-block.is-controls-active .profile-canvas-block-tools,
.profile-music-card-shell.is-controls-active .profile-music-card-tools,
.profile-music-card-shell.is-moving .profile-music-card-tools {
  opacity: 1;
  pointer-events: auto;
}

.profile-editor-canvas.is-editing .profile-canvas-block:hover .profile-canvas-resize,
.profile-editor-canvas.is-editing .profile-canvas-block:focus-within .profile-canvas-resize,
.profile-editor-canvas.is-editing .profile-canvas-block.is-selected .profile-canvas-resize {
  opacity: 1;
}

.profile-editor-canvas.is-editing .profile-canvas-block:hover .profile-canvas-resize,
.profile-editor-canvas.is-editing .profile-canvas-block:focus-within .profile-canvas-resize,
.profile-editor-canvas.is-editing .profile-canvas-block.is-selected .profile-canvas-resize {
  pointer-events: auto;
}

.profile-canvas-block.is-controls-active .profile-canvas-block-tools button,
.profile-music-card-shell.is-controls-active .profile-music-card-tools button,
.profile-music-card-shell.is-moving .profile-music-card-tools button {
  pointer-events: auto;
}

@media (hover: hover) {
  .profile-editor-canvas:has(.profile-canvas-block:hover) .profile-canvas-block.is-controls-active:not(:hover) .profile-canvas-block-tools,
  .profile-editor-panel:has(.profile-music-card-shell:hover) .profile-editor-canvas .profile-canvas-block-tools,
  .profile-editor-panel:has(.profile-canvas-block:hover) .profile-music-card-tools {
    opacity: 0;
    pointer-events: none;
  }
}

/* Keep native video controls clickable; these directions remain keyboard-resizable. */
.profile-canvas-block[data-profile-media-kind="video"] .profile-canvas-resize-s,
.profile-canvas-block[data-profile-media-kind="video"] .profile-canvas-resize-se,
.profile-canvas-block[data-profile-media-kind="video"] .profile-canvas-resize-sw {
  pointer-events: none !important;
}

.profile-canvas-resize-n,
.profile-canvas-resize-s {
  right: 0.8rem;
  left: 0.8rem;
  height: 0.55rem;
  cursor: ns-resize !important;
}

.profile-canvas-resize-n { top: 0; }
.profile-canvas-resize-s { bottom: 0; }

.profile-canvas-resize-e,
.profile-canvas-resize-w {
  top: 0.8rem;
  bottom: 0.8rem;
  width: 0.55rem;
  cursor: ew-resize !important;
}

.profile-canvas-resize-e { right: 0; }
.profile-canvas-resize-w { left: 0; }

.profile-editor-canvas .profile-canvas-resize-ne,
.profile-editor-canvas .profile-canvas-resize-se,
.profile-editor-canvas .profile-canvas-resize-sw,
.profile-editor-canvas .profile-canvas-resize-nw {
  z-index: 7;
  width: 0.9rem;
  height: 0.9rem;
}

.profile-canvas-resize-ne { top: 0; right: 0; cursor: nesw-resize !important; }
.profile-canvas-resize-se { right: 0; bottom: 0; cursor: nwse-resize !important; }
.profile-canvas-resize-sw { bottom: 0; left: 0; cursor: nesw-resize !important; }
.profile-canvas-resize-nw { top: 0; left: 0; cursor: nwse-resize !important; }

.profile-canvas-resize-ne::after,
.profile-canvas-resize-se::after,
.profile-canvas-resize-sw::after,
.profile-canvas-resize-nw::after {
  position: absolute;
  width: 0.38rem;
  height: 0.38rem;
  border-color: color-mix(in srgb, var(--profile-accent, #7c5cff) 55%, #555);
  border-style: solid;
  content: '';
  opacity: 0.55;
}

.profile-canvas-resize-ne::after { top: 0.18rem; right: 0.18rem; border-width: 1px 1px 0 0; }
.profile-canvas-resize-se::after { right: 0.18rem; bottom: 0.18rem; border-width: 0 1px 1px 0; }
.profile-canvas-resize-sw::after { bottom: 0.18rem; left: 0.18rem; border-width: 0 0 1px 1px; }
.profile-canvas-resize-nw::after { top: 0.18rem; left: 0.18rem; border-width: 1px 0 0 1px; }

.profile-editor-canvas .profile-canvas-resize:hover,
.profile-editor-canvas .profile-canvas-resize:focus-visible,
.profile-editor-canvas .profile-canvas-resize[aria-pressed="true"] {
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 28%, transparent);
}

.profile-box-tools button:hover:not(:disabled),
.profile-box-tools button[aria-pressed="true"] {
  color: #fff;
}

.profile-box-tools button:focus-visible,
.profile-canvas-resize:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.profile-rich-text,
.profile-rich-editor {
  margin: 0;
  color: #c6c6c6;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.profile-editor-canvas.is-preview .profile-rich-text {
  color: #cfcfcf;
  font-size: 0.82rem;
}

.profile-rich-text,
.profile-rich-editor-wrap,
.profile-rich-editor {
  width: 100%;
  min-width: 0;
}

.profile-rich-editor-wrap,
.profile-rich-editor {
  min-height: 100%;
}

.profile-rich-editor {
  outline: 0;
  caret-color: #fff;
}

.profile-rich-editor:empty::before {
  color: #777;
  content: attr(aria-placeholder);
  pointer-events: none;
}

.profile-rich-run.is-bold { font-weight: 700; }
.profile-rich-run.is-italic { font-style: italic; }
.profile-rich-run.is-large { font-size: 1.2em; }
.profile-rich-run.is-display { font-size: 1.62em; line-height: 1.25; }

.profile-rich-link,
.profile-rich-auto-link {
  color: #78aeea;
  text-decoration-color: color-mix(in srgb, currentColor 52%, transparent);
  text-underline-offset: 0.15em;
}

.profile-rich-link:hover {
  color: #a8cbff;
}

.profile-rich-toolbar {
  position: fixed;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.18rem;
  max-width: calc(100vw - 1rem);
  border: 1px solid #4a4a4a;
  background: #101010;
  box-shadow: 0 0.5rem 1.4rem rgba(0, 0, 0, 0.52);
  padding: 0.22rem;
  transform: translate(-50%, -100%);
}

.profile-rich-toolbar.is-below {
  transform: translate(-50%, 0);
}

.profile-editor-panel .profile-rich-toolbar button,
.profile-rich-toolbar select,
.profile-rich-toolbar input {
  width: auto;
  min-width: 1.8rem;
  min-height: 1.8rem;
  border: 0;
  background: #181818;
  color: #ddd;
  padding: 0.22rem 0.35rem;
  font: inherit;
}

.profile-editor-panel .profile-rich-toolbar button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--profile-accent, #7c5cff) 35%, #181818);
  color: #fff;
}

.profile-rich-toolbar .profile-rich-color input {
  width: 1.8rem;
  padding: 0.12rem;
}

.profile-canvas-block-badge {
  border: 0;
  background: transparent;
  padding: 0;
  overflow: visible;
}

.profile-canvas-block-badge .profile-canvas-block-content {
  overflow: visible;
  padding: 0;
}

.profile-editor-canvas.is-editing .profile-canvas-block-badge {
  padding: 0;
}

.profile-editor-canvas.is-preview .profile-canvas-block-badge {
  border: 0;
  background: transparent;
  padding: 0;
}

.profile-canvas-badge-wrap {
  position: relative;
  display: grid;
  height: 100%;
  min-height: 0;
  place-items: center;
}

.profile-canvas-block-badge .profile-canvas-badge {
  width: 100%;
  height: 100%;
  min-height: 0;
  justify-content: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-canvas-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  border: 1px solid var(--badge-color, #555);
  background: color-mix(in srgb, var(--badge-color, #777) 16%, #111);
  padding: 0.25rem 0.5rem;
}

.profile-editor-panel button.profile-canvas-badge-face {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  border: 1px solid var(--badge-color, #555);
  border-radius: 0;
  background: color-mix(in srgb, var(--badge-color, #777) 16%, #111);
  color: #e7e7e7;
  font: inherit;
  padding: 0.25rem 0.5rem;
}

.profile-editor-panel button.profile-canvas-badge-face:hover:not(:disabled),
.profile-editor-panel button.profile-canvas-badge-face:focus-visible {
  border-color: color-mix(in srgb, var(--badge-color, #777) 75%, #fff);
}

.profile-canvas-badge.is-system {
  border-style: double;
}

.profile-canvas-badge-icon {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--badge-color, #777) 55%, transparent);
  overflow: hidden;
}

.profile-canvas-badge-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-canvas-media {
  display: grid;
  height: 100%;
  gap: 0;
  min-height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
}

.profile-editor-canvas.is-editing .profile-canvas-block-media .profile-canvas-block-content {
  overflow: auto;
  padding: 0;
}

.profile-editor-canvas.is-preview .profile-canvas-block-media .profile-canvas-block-content {
  overflow: hidden;
}

.profile-editor-canvas.is-preview .profile-canvas-media {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
}

.profile-canvas-media-description {
  display: grid;
  gap: 0.35rem;
  border-top: 1px solid #292929;
  background: #0b0b0b;
  padding: 0.45rem;
}

.profile-canvas-media-description label {
  display: grid;
  gap: 0.2rem;
}

.profile-canvas-media-description span {
  color: #aaa;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-canvas-media-description input {
  min-width: 0;
  border: 1px solid #353535;
  background: #050505;
  color: var(--color-text);
  font: 0.68rem/1.35 var(--font-mono);
  padding: 0.3rem 0.4rem;
}

.profile-canvas-media-description input:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 1px;
}

.profile-canvas-media-caption {
  display: block;
  overflow-wrap: anywhere;
  background: #0b0b0b;
  color: #c7c7c7;
  font-size: 0.7rem;
  line-height: 1.4;
  padding: 0.4rem 0.5rem;
}

.profile-canvas-media > img,
.profile-canvas-media > video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #080808;
}

.profile-editor-canvas.is-preview .profile-canvas-media > img,
.profile-editor-canvas.is-preview .profile-canvas-media > video {
  height: 100%;
}

.profile-canvas-empty,
.profile-canvas-spacer-label {
  color: #858585;
  font-size: 0.7rem;
}

.profile-canvas-spacer-label {
  display: grid;
  height: 100%;
  place-items: center;
}

.profile-canvas-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-badge-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto;
  gap: 0.5rem;
  width: min(18rem, calc(100vw - 2rem));
  border: 1px solid #3a3a3a;
  background: #0d0d0d;
  box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.45);
  padding: 0.55rem;
}

.profile-canvas-badge-wrap .profile-badge-popover {
  top: calc(100% + 0.3rem);
  left: 50%;
  place-items: stretch;
  transform: translateX(-50%);
}

.profile-canvas-block[data-profile-popover-align="left"] .profile-badge-popover {
  right: auto;
  left: 0;
  transform: none;
}

.profile-canvas-block[data-profile-popover-align="right"] .profile-badge-popover {
  right: 0;
  left: auto;
  transform: none;
}

.profile-badge-popover-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 0.35rem;
}

@media (max-width: 720px) {
  .profile-editor-appearance-menu {
    align-items: stretch;
  }

  .profile-editor-canvas.is-editing {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .profile-editor-canvas.is-editing .profile-canvas-block {
    flex: 0 0 auto;
    width: 100%;
    min-height: var(--profile-block-narrow-height, 6rem);
    margin-top: var(--profile-block-narrow-gap, 0);
  }

  .profile-editor-canvas .profile-canvas-resize-n,
  .profile-editor-canvas .profile-canvas-resize-s {
    right: auto;
    left: 50%;
    width: max(2.75rem, calc(100% - 5.5rem));
    height: 2.75rem;
    transform: translateX(-50%);
  }

  .profile-editor-canvas .profile-canvas-resize-n { top: 0; }
  .profile-editor-canvas .profile-canvas-resize-s { bottom: 0; }

  .profile-editor-canvas .profile-canvas-resize-e,
  .profile-editor-canvas .profile-canvas-resize-w {
    top: 50%;
    bottom: auto;
    width: 2.75rem;
    height: 2.75rem;
    transform: translateY(-50%);
  }

  .profile-editor-canvas .profile-canvas-resize-e { right: 0; }
  .profile-editor-canvas .profile-canvas-resize-w { left: 0; }

  .profile-editor-canvas .profile-canvas-resize-ne,
  .profile-editor-canvas .profile-canvas-resize-se,
  .profile-editor-canvas .profile-canvas-resize-sw,
  .profile-editor-canvas .profile-canvas-resize-nw {
    width: 2.75rem;
    height: 2.75rem;
  }

  .profile-box-tools .profile-canvas-drag,
  .profile-box-tools .profile-canvas-remove,
  .profile-box-action-placeholder {
    width: 2.75rem;
    height: 2.75rem;
    border: 0 !important;
    background: transparent !important;
  }

  .profile-box-tools .profile-canvas-drag > span,
  .profile-box-tools .profile-canvas-remove > span {
    display: block;
  }

  .profile-box-tools .profile-canvas-drag > span {
    width: 1.1rem;
    height: 1.1rem;
  }

  .profile-box-tools .profile-canvas-remove > span {
    width: 1.05rem;
    height: 1.05rem;
  }
}

@media (max-width: 540px) {
  .profile-music-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-editor-canvas.is-preview {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .profile-editor-canvas.is-preview .profile-canvas-block {
    flex: 0 0 auto;
    width: 100%;
    min-height: var(--profile-block-narrow-height, 2rem);
    margin-top: var(--profile-block-narrow-gap, 0);
  }

  .profile-editor-canvas.is-preview .profile-canvas-block-content {
    padding: 0.55rem;
  }

  .profile-editor-canvas.is-preview .profile-canvas-block-media .profile-canvas-block-content,
  .profile-editor-canvas.is-preview .profile-canvas-block-badge .profile-canvas-block-content {
    padding: 0;
  }
}

@media (max-width: 480px) {
  .profile-owner-toolbar {
    align-items: stretch;
  }

  .profile-owner-toolbar button,
  .profile-editor-add button {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 2.75rem;
  }

  .profile-editor-visibility {
    min-height: 2.75rem !important;
  }

  .profile-editor-save-state {
    flex: 1 0 100%;
    margin-left: 0;
  }

  .profile-editor-add {
    align-items: stretch;
  }

  .profile-editor-add .profile-editor-add-trigger {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .profile-editor-panel input,
  .profile-editor-panel textarea,
  .profile-editor-panel select {
    font-size: 16px;
  }

  .profile-status.profile-editor-inline-status {
    max-width: 100%;
  }

  .profile-editor-status-mirror,
  .profile-editor-inline-status input {
    font-size: 16px;
  }

  .profile-editor-inline-status input {
    width: 100%;
  }

  .profile-editor-panel .profile-rich-toolbar button,
  .profile-rich-toolbar select,
  .profile-rich-toolbar input {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .profile-editor-avatar-change,
  .profile-editor-avatar-clear {
    top: -0.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    background: transparent;
  }

  .profile-editor-avatar-change {
    right: -0.75rem;
  }

  .profile-editor-avatar-clear {
    left: -0.75rem;
  }

  .profile-editor-avatar-change > span,
  .profile-editor-avatar-clear > span {
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border: 1px solid #454545;
    border-radius: 999px;
    background: #101010;
  }
}

@media (pointer: coarse) {
  .profile-owner-toolbar button,
  .profile-editor-add button,
  .profile-badge-popover button,
  .profile-editor-entry-button,
  .profile-editor-appearance > summary {
    min-height: 2.75rem;
  }

  .profile-editor-appearance > summary {
    display: flex;
    align-items: center;
  }

  .profile-editor-visibility {
    min-height: 2.75rem !important;
  }

  .profile-editor-add .profile-editor-add-trigger {
    width: 2.75rem;
    height: 2.75rem;
  }

  .profile-editor-panel .profile-rich-toolbar button,
  .profile-rich-toolbar select,
  .profile-rich-toolbar input {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .profile-editor-avatar-change,
  .profile-editor-avatar-clear {
    top: -0.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    background: transparent;
  }

  .profile-editor-avatar-change {
    right: -0.75rem;
  }

  .profile-editor-avatar-clear {
    left: -0.75rem;
  }

  .profile-editor-avatar-change > span,
  .profile-editor-avatar-clear > span {
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border: 1px solid #454545;
    border-radius: 999px;
    background: #101010;
  }

  .profile-editor-canvas .profile-canvas-resize-n,
  .profile-editor-canvas .profile-canvas-resize-s {
    right: auto;
    left: 50%;
    width: 2.25rem;
    height: 0.8rem;
    transform: translateX(-50%);
  }

  .profile-editor-canvas .profile-canvas-resize-e,
  .profile-editor-canvas .profile-canvas-resize-w {
    top: 50%;
    bottom: auto;
    width: 0.8rem;
    height: 2.25rem;
    transform: translateY(-50%);
  }

  .profile-editor-canvas .profile-canvas-resize-ne,
  .profile-editor-canvas .profile-canvas-resize-se,
  .profile-editor-canvas .profile-canvas-resize-sw,
  .profile-editor-canvas .profile-canvas-resize-nw {
    width: 1.5rem;
    height: 1.5rem;
  }

  .profile-box-tools .profile-canvas-drag,
  .profile-box-tools .profile-canvas-remove,
  .profile-box-action-placeholder {
    width: 2.75rem;
    height: 2.75rem;
  }
}

@media (pointer: coarse) and (max-width: 720px) {
  .profile-box-tools .profile-canvas-drag,
  .profile-box-tools .profile-canvas-remove,
  .profile-box-action-placeholder {
    width: 2.75rem;
    height: 2.75rem;
  }
}
