/*
 * Kaiyo profile room
 * A playful anime identity layer that sits on top of the legacy profile UI.
 * All selectors are scoped so the shared header, footer and other pages stay untouched.
 */

body.profile-page {
  --room-accent: #ca6969;
  --room-accent-2: #c4180c;
  --room-accent-rgb: 202, 105, 105;
  --room-accent-2-rgb: 196, 24, 12;
  --room-ink: #08090d;
  --room-panel: rgba(13, 14, 20, 0.82);
  --room-line: rgba(255, 255, 255, 0.1);
  --room-muted: rgba(238, 240, 247, 0.56);
  padding-top: 104px;
  color: #f8f8fb;
  background-color: #08090c;
}

/* --------------------------------------------------------------------------
   Collection creator
   -------------------------------------------------------------------------- */
body.profile-page #profile-list-modal {
  display: grid;
  place-items: center;
  padding: 20px;
}

body.profile-page #profile-list-modal[hidden] { display: none; }

body.profile-page #profile-list-modal .profile-edit-backdrop {
  background: rgba(4, 5, 8, 0.8);
  backdrop-filter: blur(14px) saturate(0.82);
  -webkit-backdrop-filter: blur(14px) saturate(0.82);
}

body.profile-page #profile-list-modal .profile-list-dialog {
  width: min(980px, 100%);
  height: min(720px, calc(100dvh - 40px));
  max-height: none;
  margin: 0;
  display: grid;
  grid-template-rows: 94px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 28px;
  background: #0b0c10;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 1px rgba(255, 255, 255, 0.035);
  opacity: 0;
  transform: translateY(22px) scale(0.97);
  filter: blur(5px);
  transition: opacity 0.28s ease, transform 0.46s cubic-bezier(0.16, 1, 0.3, 1), filter 0.34s ease;
}

body.profile-page #profile-list-modal.is-open .profile-list-dialog {
  opacity: 1;
  transform: none;
  filter: none;
}

body.profile-page #profile-list-modal .profile-list-head {
  min-height: 0;
  padding: 16px 20px 16px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(13, 14, 19, 0.98);
}

body.profile-page .profile-list-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

body.profile-page .profile-list-title-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--room-accent-rgb), 0.24);
  border-radius: 14px;
  background: radial-gradient(circle, rgba(var(--room-accent-rgb), 0.23), rgba(var(--room-accent-2-rgb), 0.07));
}

body.profile-page .profile-list-title-icon img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(47%) sepia(19%) saturate(1397%) hue-rotate(313deg) brightness(94%) contrast(88%);
}

body.profile-page .profile-list-title-wrap > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.profile-page .profile-list-kicker {
  color: var(--room-accent);
  font-size: 7px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.18em;
}

body.profile-page #profile-list-modal .profile-list-head h2 {
  margin: 0;
  color: #fafafd;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

body.profile-page .profile-list-title-wrap p {
  margin: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  line-height: 1.2;
}

body.profile-page #profile-list-modal .profile-edit-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.035);
  font-size: 22px;
}

body.profile-page #profile-list-modal .profile-edit-close:hover {
  border-color: rgba(var(--room-accent-rgb), 0.26);
  color: #fff;
  background: rgba(var(--room-accent-2-rgb), 0.08);
}

body.profile-page #profile-list-modal .profile-edit-form {
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  overflow: hidden;
}

body.profile-page .profile-list-builder {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  overflow: hidden;
}

body.profile-page .profile-list-preview {
  min-width: 0;
  padding: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 13px;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--room-accent-rgb), 0.075), transparent 34%),
    #090a0e;
}

body.profile-page .profile-list-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.profile-page .profile-list-preview-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.16em;
}

body.profile-page .profile-list-preview-head i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--room-accent);
  box-shadow: 0 0 10px rgba(var(--room-accent-2-rgb), 0.58);
}

body.profile-page .profile-list-preview-head small {
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
}

body.profile-page .profile-list-preview-card {
  min-height: 0;
  align-self: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(23, 22, 27, 0.96), rgba(11, 12, 17, 0.98));
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.36), inset 0 1px rgba(255, 255, 255, 0.04);
}

body.profile-page .profile-list-preview-cover {
  position: relative;
  height: clamp(180px, 27vh, 230px);
  overflow: hidden;
  background: linear-gradient(135deg, #251212, #120d10 58%, #0b0c10);
}

body.profile-page .profile-list-preview-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 48%, rgba(7, 8, 12, 0.74)),
    radial-gradient(circle at 78% 16%, rgba(var(--room-accent-rgb), 0.26), transparent 34%);
  pointer-events: none;
}

body.profile-page #profile-list-cover-preview-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body.profile-page #profile-list-cover-preview-image[hidden] { display: none; }

body.profile-page .profile-list-cover-preview-placeholder {
  position: absolute;
  inset: 18px;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 7px;
  opacity: 0.62;
  transform: rotate(-3deg) scale(1.03);
}

body.profile-page .profile-list-cover-preview-placeholder[hidden] { display: none; }

body.profile-page .profile-list-cover-preview-placeholder span {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(var(--room-accent-rgb), 0.2), rgba(var(--room-accent-2-rgb), 0.035));
}

body.profile-page .profile-list-cover-preview-placeholder span:first-child {
  grid-row: 1 / 3;
  background: linear-gradient(145deg, rgba(var(--room-accent-rgb), 0.3), rgba(var(--room-accent-2-rgb), 0.07));
}

body.profile-page .profile-list-preview-visibility {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  min-height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(var(--room-accent-rgb), 0.26);
  border-radius: 999px;
  color: #f1c3c3;
  background: rgba(8, 9, 13, 0.68);
  backdrop-filter: blur(10px);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

body.profile-page .profile-list-preview-visibility.is-private {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.6);
}

body.profile-page .profile-list-preview-copy {
  min-height: 150px;
  padding: 19px 19px 16px;
  display: flex;
  flex-direction: column;
}

body.profile-page .profile-list-preview-copy > span {
  color: var(--room-accent);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.17em;
}

body.profile-page .profile-list-preview-copy > strong {
  margin-top: 6px;
  overflow: hidden;
  color: #f8f8fb;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.035em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.profile-page .profile-list-preview-copy > p {
  margin: 8px 0 16px;
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.profile-page .profile-list-preview-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
}

body.profile-page .profile-list-preview-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.profile-page .profile-list-preview-foot i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--room-accent);
}

body.profile-page .profile-list-preview-foot b {
  color: var(--room-accent);
  font-size: 14px;
}

body.profile-page .profile-list-preview-note {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.31);
  font-size: 8px;
  text-align: center;
}

body.profile-page .profile-list-preview-note span { color: var(--room-accent); }

body.profile-page .profile-list-fields {
  min-width: 0;
  padding: 25px 26px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  background: #0d0e12;
}

body.profile-page .profile-list-fields::-webkit-scrollbar { width: 5px; }
body.profile-page .profile-list-fields::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(255, 255, 255, 0.14); }

body.profile-page .profile-list-section-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
}

body.profile-page .profile-list-section-head > span {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--room-accent-rgb), 0.2);
  border-radius: 10px;
  color: var(--room-accent);
  background: rgba(var(--room-accent-2-rgb), 0.065);
  font-size: 8px;
  font-weight: 950;
}

body.profile-page .profile-list-section-head > div { min-width: 0; display: grid; gap: 3px; }
body.profile-page .profile-list-section-head h3 { margin: 0; color: #f4f4f7; font-size: 13px; font-weight: 850; }
body.profile-page .profile-list-section-head p { margin: 0; color: rgba(255, 255, 255, 0.34); font-size: 8px; }

body.profile-page #profile-list-modal .profile-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(150px, 0.85fr);
  gap: 11px;
}

body.profile-page #profile-list-modal .profile-edit-field {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 0;
}

body.profile-page #profile-list-modal .profile-edit-field > span,
body.profile-page .profile-list-field-label {
  display: block;
  color: rgba(255, 255, 255, 0.54);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.profile-page #profile-list-modal .profile-edit-field > span em {
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 7px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: none;
}

body.profile-page #profile-list-modal .profile-edit-field input,
body.profile-page #profile-list-modal .profile-edit-field select,
body.profile-page #profile-list-modal .profile-edit-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 13px;
  outline: 0;
  color: rgba(255, 255, 255, 0.86);
  background: #090a0e;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.32);
  font: 600 12px/1.45 "Segoe UI", sans-serif;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.profile-page #profile-list-modal .profile-edit-field input,
body.profile-page #profile-list-modal .profile-edit-field select {
  height: 50px;
  padding: 0 14px;
}

body.profile-page #profile-list-modal .profile-edit-field select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
}

body.profile-page #profile-list-modal .profile-edit-field input::placeholder,
body.profile-page #profile-list-modal .profile-edit-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

body.profile-page #profile-list-modal .profile-edit-field input:focus,
body.profile-page #profile-list-modal .profile-edit-field select:focus,
body.profile-page #profile-list-modal .profile-edit-field textarea:focus {
  border-color: rgba(var(--room-accent-rgb), 0.5);
  background: #0b0c10;
  box-shadow: 0 0 0 3px rgba(var(--room-accent-2-rgb), 0.075);
}

body.profile-page .profile-list-select-arrow {
  position: absolute;
  right: 14px;
  bottom: 17px;
  color: var(--room-accent);
  font-size: 14px;
  font-style: normal;
  line-height: 1;
  pointer-events: none;
}

body.profile-page .profile-list-cover-field {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

body.profile-page .profile-list-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body.profile-page .profile-list-cover-picker {
  min-height: 72px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(90px, auto);
  align-items: center;
  gap: 11px;
  border: 1px dashed rgba(var(--room-accent-rgb), 0.25);
  border-radius: 14px;
  background: rgba(var(--room-accent-2-rgb), 0.035);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

body.profile-page .profile-list-cover-picker:hover,
body.profile-page .profile-list-file-input:focus-visible + .profile-list-cover-picker {
  border-color: rgba(var(--room-accent-rgb), 0.5);
  background: rgba(var(--room-accent-2-rgb), 0.065);
  transform: translateY(-1px);
}

body.profile-page .profile-list-cover-picker-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--room-accent-rgb), 0.18);
  border-radius: 12px;
  background: rgba(var(--room-accent-2-rgb), 0.08);
}

body.profile-page .profile-list-cover-picker-icon img {
  width: 16px;
  height: 16px;
  opacity: 0.8;
  filter: brightness(0) saturate(100%) invert(47%) sepia(19%) saturate(1397%) hue-rotate(313deg) brightness(94%) contrast(88%);
}

body.profile-page .profile-list-cover-picker-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

body.profile-page .profile-list-cover-picker-copy strong { color: rgba(255, 255, 255, 0.82); font-size: 11px; }
body.profile-page .profile-list-cover-picker-copy small { color: rgba(255, 255, 255, 0.3); font-size: 7px; }

body.profile-page .profile-list-cover-name {
  max-width: 140px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: right;
}

body.profile-page #profile-list-modal .profile-list-description-field { margin-top: 18px; }

body.profile-page #profile-list-modal .profile-list-description-field textarea {
  min-height: 102px;
  height: 102px;
  max-height: 150px;
  padding: 13px 14px 27px;
  resize: vertical;
}

body.profile-page #profile-list-modal .profile-edit-counter {
  position: absolute;
  right: 12px;
  bottom: 9px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
}

body.profile-page #profile-list-modal .profile-edit-status {
  margin: 0;
  padding: 9px 24px;
  border-width: 1px 0 0;
  border-color: rgba(69, 203, 129, 0.14);
  border-radius: 0;
  color: #9be1b9;
  background: rgba(69, 203, 129, 0.055);
  font-size: 9px;
}

body.profile-page #profile-list-modal .profile-edit-status.is-error {
  border-color: rgba(var(--room-accent-rgb), 0.18);
  color: #e5a0a0;
  background: rgba(var(--room-accent-2-rgb), 0.055);
}

body.profile-page #profile-list-modal .profile-edit-actions {
  min-height: 76px;
  margin: 0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: #101116;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.22);
}

body.profile-page #profile-list-modal .profile-edit-actions > p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 8px;
}

body.profile-page #profile-list-modal .profile-edit-actions > p span {
  color: var(--room-accent);
  font-size: 6px;
  text-shadow: 0 0 8px rgba(var(--room-accent-2-rgb), 0.5);
}

body.profile-page #profile-list-modal .profile-edit-actions > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

body.profile-page #profile-list-modal .profile-edit-actions .profile-secondary-btn,
body.profile-page #profile-list-modal .profile-edit-actions .profile-primary-btn {
  width: auto;
  min-width: 104px;
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 850;
}

body.profile-page #profile-list-modal .profile-edit-actions .profile-secondary-btn {
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: rgba(255, 255, 255, 0.66) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

body.profile-page #profile-list-modal .profile-edit-actions .profile-primary-btn {
  min-width: 166px;
  border-color: rgba(var(--room-accent-rgb), 0.34) !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--room-accent), var(--room-accent-2)) !important;
  box-shadow: 0 10px 24px rgba(var(--room-accent-2-rgb), 0.24) !important;
}

body.profile-page #profile-list-modal .profile-edit-actions .profile-primary-btn:hover:not(:disabled) {
  box-shadow: 0 13px 29px rgba(var(--room-accent-2-rgb), 0.32) !important;
}

@media (max-width: 820px) {
  body.profile-page #profile-list-modal { padding: 10px; }

  body.profile-page #profile-list-modal .profile-list-dialog {
    width: min(720px, 100%);
    height: calc(100dvh - 20px);
    grid-template-rows: 84px minmax(0, 1fr);
    border-radius: 22px;
  }

  body.profile-page .profile-list-builder {
    display: block;
    overflow-y: auto;
  }

  body.profile-page .profile-list-preview {
    padding: 16px;
    display: block;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  body.profile-page .profile-list-preview-head,
  body.profile-page .profile-list-preview-note { display: none; }

  body.profile-page .profile-list-preview-card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
  }

  body.profile-page .profile-list-preview-cover { height: 150px; }
  body.profile-page .profile-list-preview-copy { min-height: 150px; }
  body.profile-page .profile-list-fields { overflow: visible; padding: 22px; }
}

@media (max-width: 580px) {
  body.profile-page #profile-list-modal { padding: 0; }

  body.profile-page #profile-list-modal .profile-list-dialog {
    width: 100%;
    height: 100dvh;
    grid-template-rows: 72px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
  }

  body.profile-page #profile-list-modal .profile-list-head { padding: 11px 13px 11px 16px; }
  body.profile-page .profile-list-title-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  body.profile-page .profile-list-kicker,
  body.profile-page .profile-list-title-wrap p { display: none; }
  body.profile-page #profile-list-modal .profile-list-head h2 { font-size: 18px; }
  body.profile-page #profile-list-modal .profile-edit-close { width: 36px; height: 36px; flex-basis: 36px; }

  body.profile-page #profile-list-modal .profile-edit-form { grid-template-rows: minmax(0, 1fr) auto auto; }
  body.profile-page .profile-list-preview { display: none; }
  body.profile-page .profile-list-fields { height: 100%; padding: 18px 14px 22px; overflow-y: auto; }
  body.profile-page #profile-list-modal .profile-edit-grid { grid-template-columns: 1fr; gap: 14px; }
  body.profile-page .profile-list-cover-field,
  body.profile-page #profile-list-modal .profile-list-description-field { margin-top: 16px; }

  body.profile-page .profile-list-cover-picker {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  body.profile-page .profile-list-cover-name {
    grid-column: 1 / -1;
    max-width: 100%;
    padding-left: 2px;
    text-align: left;
  }

  body.profile-page #profile-list-modal .profile-edit-actions {
    min-height: 70px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  body.profile-page #profile-list-modal .profile-edit-actions > p { display: none; }
  body.profile-page #profile-list-modal .profile-edit-actions > div { width: 100%; }

  body.profile-page #profile-list-modal .profile-edit-actions .profile-secondary-btn,
  body.profile-page #profile-list-modal .profile-edit-actions .profile-primary-btn {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 10px;
  }

  body.profile-page #profile-list-modal .profile-edit-actions .profile-primary-btn { flex-grow: 1.45; }
}

body.profile-page .profile-discord-decoration-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 15px 16px;
  border: 1px solid rgba(88, 101, 242, 0.2);
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.055);
}

body.profile-page .profile-discord-decoration-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.profile-page .profile-discord-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #5865f2;
}

body.profile-page .profile-discord-mark img { width: 20px; height: 20px; object-fit: contain; }
body.profile-page .profile-discord-decoration-copy > span:last-child { min-width: 0; display: grid; gap: 4px; }
body.profile-page .profile-discord-decoration-copy strong { color: #eef0f6; font-size: 11px; }
body.profile-page .profile-discord-decoration-copy small { color: rgba(255,255,255,.43); font-size: 9px; line-height: 1.4; }

body.profile-page .profile-discord-switch { position: relative; flex: 0 0 auto; cursor: pointer; }
body.profile-page .profile-discord-switch input { position: absolute; opacity: 0; pointer-events: none; }
body.profile-page .profile-discord-switch i { position: relative; width: 42px; height: 23px; display: block; border-radius: 999px; background: #303440; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); transition: background .2s ease; }
body.profile-page .profile-discord-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #969daa; transition: left .22s cubic-bezier(.2,.8,.2,1), background .2s ease; }
body.profile-page .profile-discord-switch input:checked + i { background: #5865f2; }
body.profile-page .profile-discord-switch input:checked + i::after { left: 22px; background: #fff; }
body.profile-page .profile-discord-switch input:disabled + i { opacity: .45; cursor: not-allowed; }
body.profile-page .profile-discord-switch input:focus-visible + i { outline: 2px solid #aeb5ff; outline-offset: 3px; }

body.profile-page .profile-editor-preview-avatar { overflow: visible !important; }
body.profile-page .profile-editor-preview-avatar > img:not(.profile-editor-preview-decoration),
body.profile-page .profile-editor-preview-avatar > span { border-radius: inherit; }
body.profile-page .profile-editor-preview-decoration {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 130%;
  height: 130%;
  display: none;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
body.profile-page .profile-editor-preview-decoration.is-visible { display: block; }

@media (max-width: 640px) {
  body.profile-page .profile-discord-decoration-control { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  body.profile-page #profile-list-modal .profile-list-dialog { transition: opacity 0.15s ease; }
}

body.profile-page .profile-page-backdrop::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(var(--room-accent-2-rgb), 0.12), transparent 34%),
    linear-gradient(180deg, rgba(7, 8, 12, 0.28) 0%, rgba(7, 8, 12, 0.76) 62%, #08090c 100%);
}

body.profile-page .profile-shell {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  padding: 0 0 96px;
}

body.profile-page .profile-overview {
  max-width: 1240px;
}

/* Immersive profile hero */
body.profile-page .profile-room-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 30px;
  background:
    radial-gradient(circle at 82% 105%, rgba(var(--room-accent-rgb), 0.11), transparent 32%),
    linear-gradient(145deg, rgba(18, 19, 26, 0.94), rgba(8, 9, 13, 0.94));
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.045);
  isolation: isolate;
}

body.profile-page .profile-room-hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  right: -110px;
  bottom: -150px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(var(--room-accent-rgb), 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(var(--room-accent-rgb), 0.025), 0 0 0 92px rgba(var(--room-accent-2-rgb), 0.018);
  pointer-events: none;
}

body.profile-page .profile-summary-banner {
  position: relative;
  z-index: 1;
}

body.profile-page .profile-banner-shell {
  height: clamp(280px, 28vw, 350px);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  box-shadow: none;
}

body.profile-page .profile-banner-backdrop::after,
body.profile-page .profile-banner-backdrop.has-image::after {
  background:
    linear-gradient(90deg, rgba(8, 9, 13, 0.46), transparent 48%),
    linear-gradient(180deg, rgba(8, 9, 13, 0.05) 30%, rgba(8, 9, 13, 0.84) 100%);
}

body.profile-page .profile-banner-content {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 30px 34px;
}

body.profile-page .profile-header {
  width: auto;
  margin: -64px 30px 0;
  padding: 0 0 26px;
  gap: 24px;
}

body.profile-page .profile-avatar-upload-hero {
  width: 148px;
  height: 148px;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.38));
}

body.profile-page .profile-avatar-hero {
  border: 7px solid #0c0d12;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 16px 34px rgba(0, 0, 0, 0.4);
}

body.profile-page .profile-presence {
  margin-top: 8px;
  background: rgba(11, 12, 17, 0.92);
}

body.profile-page .profile-header-copy {
  padding-top: 75px;
}

body.profile-page .profile-main-meta {
  gap: 7px;
}

body.profile-page .profile-name-row h1 {
  font-size: clamp(30px, 3.3vw, 46px);
  letter-spacing: -0.045em;
}

body.profile-page .profile-edit-chip {
  width: 38px;
  height: 38px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

body.profile-page .profile-handle,
body.profile-page .profile-member-since {
  font-size: 12px;
}

body.profile-page .profile-submeta-row {
  align-items: center;
}

body.profile-page .profile-kaiyocoin {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  border: 1px solid rgba(255, 195, 83, 0.17);
  border-radius: 999px;
  color: #fff;
  background: rgba(10, 11, 15, 0.62);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045), 0 6px 16px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

body.profile-page .profile-kaiyocoin[hidden] { display: none !important; }

body.profile-page .profile-kaiyocoin img {
  width: 19px;
  height: 19px;
  display: block;
  flex: 0 0 19px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(255, 35, 53, 0.28));
}

body.profile-page .profile-kaiyocoin strong {
  color: #f8f8fa;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

body.profile-page .profile-kaiyocoin small {
  color: #d8a94c;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
}

body.profile-page .profile-kaiyocoin:hover,
body.profile-page .profile-kaiyocoin:focus-visible {
  border-color: rgba(255, 195, 83, 0.3);
  outline: none;
  background: rgba(255, 255, 255, 0.075);
}

/* Role signature: quiet metadata instead of heavy colored pills. */
body.profile-page .profile-role-tags {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0;
  margin: 0;
}

body.profile-page .profile-role-tag {
  --role-palette-start: #aeb4c0;
  --role-palette-end: #596170;
  position: relative;
  min-height: 20px;
  margin: 0 9px 0 0;
  padding: 0 10px 3px 0;
  border: 0 !important;
  border-radius: 0;
  color: var(--role-palette-start);
  background-color: transparent !important;
  background-image: linear-gradient(90deg, var(--role-palette-start), var(--role-palette-end)) !important;
  background-repeat: no-repeat !important;
  background-position: left bottom !important;
  background-size: calc(100% - 10px) 2px !important;
  box-shadow: none !important;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  text-shadow: none;
}

body.profile-page .profile-role-tag + .profile-role-tag {
  padding-left: 14px;
  background-position: 14px bottom !important;
  background-size: calc(100% - 24px) 2px !important;
}

body.profile-page .profile-role-tag + .profile-role-tag::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: none;
  transform: translateY(-50%);
}

body.profile-page .profile-role-tag::before,
body.profile-page .profile-role-tag.role-premium::before,
body.profile-page .profile-role-tag.role-team::before {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  color: currentColor;
  background: none;
  font-size: 10px;
  filter: none;
}

body.profile-page .profile-role-tag.role-superadmin {
  --role-palette-start: #ca6969;
  --role-palette-end: #c4180c;
}

body.profile-page .profile-role-tag.role-admin {
  --role-palette-start: #d99a68;
  --role-palette-end: #ad4d24;
}

body.profile-page .profile-role-tag.role-uploader {
  --role-palette-start: #82a9e6;
  --role-palette-end: #3f68c9;
}

body.profile-page .profile-role-tag.role-fansub {
  --role-palette-start: #d98d73;
  --role-palette-end: #b94229;
}

body.profile-page .profile-role-tag.role-premium {
  --role-palette-start: #e5c36a;
  --role-palette-end: #b47b16;
}

body.profile-page .profile-role-tag.role-team {
  --role-palette-start: #b8aecf;
  --role-palette-end: #675888;
}

body.profile-page .profile-role-tag.is-banned {
  --role-palette-start: #d56672;
  --role-palette-end: #a80d24;
}

body.profile-page .profile-bio-block {
  margin-top: 4px;
}

body.profile-page .profile-summary-bio {
  min-height: 50px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: rgba(250, 247, 243, 0.8);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
  font-size: 13px;
  line-height: 1.55;
}

/* Otaku passport strip */
body.profile-page .profile-stats-standalone {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(270px, 1.45fr) repeat(3, minmax(130px, 0.7fr));
  gap: 0;
  margin: 0;
  padding: 18px 26px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(5, 6, 10, 0.2);
}

body.profile-page .profile-level-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  min-height: 82px;
  padding: 8px 26px 8px 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.profile-page .profile-level-orbit {
  position: relative;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--room-accent-rgb), 0.36);
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle, rgba(var(--room-accent-rgb), 0.25), rgba(var(--room-accent-2-rgb), 0.06) 64%, transparent 66%);
  box-shadow: inset 0 0 18px rgba(var(--room-accent-rgb), 0.08), 0 0 24px rgba(var(--room-accent-2-rgb), 0.08);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

body.profile-page .profile-level-orbit::before,
body.profile-page .profile-level-orbit::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--room-accent);
  box-shadow: 0 0 10px var(--room-accent);
}

body.profile-page .profile-level-orbit::before { top: 3px; right: 12px; }
body.profile-page .profile-level-orbit::after { bottom: 6px; left: 8px; opacity: 0.55; }

body.profile-page .profile-level-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body.profile-page .profile-level-copy > span {
  color: var(--room-accent);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

body.profile-page .profile-level-copy strong {
  overflow: hidden;
  color: #f7f7fa;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.profile-page .profile-level-copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.profile-page .profile-level-progress {
  width: min(170px, 100%);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

body.profile-page .profile-level-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--room-accent), var(--room-accent-2));
  box-shadow: 0 0 12px rgba(var(--room-accent-2-rgb), 0.48);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

body.profile-page .profile-stat-box {
  min-width: 0;
  min-height: 82px;
  padding: 10px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.profile-page .profile-stat-box:last-child { border-right: 0; }

body.profile-page .profile-stat-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

body.profile-page .profile-stat-icon::after { display: none; }
body.profile-page .profile-stat-icon-image { width: 15px; height: 15px; }

body.profile-page .profile-stat-copy {
  display: grid;
  justify-items: start;
  gap: 2px;
  text-align: left;
}

body.profile-page .profile-stat-box strong {
  color: #fff;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1;
}

body.profile-page .profile-stat-label {
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Rounded room navigation */
body.profile-page .profile-overview .profile-section-tabs {
  width: auto;
  max-width: calc(100% - 104px);
  display: inline-grid;
  grid-template-columns: repeat(4, max-content);
  gap: 3px;
  margin: 14px 0 0 52px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: rgba(9, 10, 14, 0.82);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

body.profile-page .profile-overview .profile-section-tabs::after { display: none; }

body.profile-page .profile-overview .profile-section-tab {
  position: relative;
  width: auto !important;
  min-width: 126px !important;
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid transparent !important;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  letter-spacing: 0;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease !important;
}

body.profile-page .profile-overview .profile-section-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 34px;
  height: 2px;
  display: block;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(90deg, var(--room-accent), var(--room-accent-2));
  box-shadow: 0 0 9px rgba(var(--room-accent-2-rgb), 0.32);
  transform: translateX(-50%) scaleX(0.45);
  transition: opacity 0.2s ease, transform 0.25s ease;
  pointer-events: none;
}

body.profile-page .profile-overview .profile-section-tab:hover,
body.profile-page .profile-overview .profile-section-tab:focus-visible {
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #fff;
  background: rgba(255, 255, 255, 0.045) !important;
  text-shadow: none;
}

body.profile-page .profile-overview .profile-section-tab.is-active {
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.075)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045), 0 7px 18px rgba(0, 0, 0, 0.2);
  text-shadow: none;
}

body.profile-page .profile-overview .profile-section-tab.is-active::after {
  display: none;
}

body.profile-page .profile-overview .profile-section-tab-icon,
body.profile-page .profile-overview .profile-section-tab-icon-image {
  width: 16px;
  height: 16px;
}

body.profile-page .profile-overview .profile-section-tab.is-active .profile-section-tab-icon-image {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(47%) sepia(19%) saturate(1397%) hue-rotate(313deg) brightness(94%) contrast(88%);
}

/* The showcase feels like two shelves instead of one long dashboard. */
body.profile-page .profile-tab-panel.is-active[data-profile-panel="general"] {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  gap: 18px;
  align-items: stretch;
}

body.profile-page .profile-tab-panel[data-profile-panel="general"] > .profile-panel {
  min-width: 0;
  min-height: 378px;
  margin-top: 18px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--room-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--room-accent-rgb), 0.07), transparent 38%),
    linear-gradient(145deg, rgba(19, 20, 27, 0.82), rgba(10, 11, 16, 0.78));
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.035);
}

body.profile-page .profile-tab-panel[data-profile-panel="general"] > .profile-panel:last-child {
  background:
    radial-gradient(circle at 90% 8%, rgba(var(--room-accent-2-rgb), 0.08), transparent 36%),
    linear-gradient(145deg, rgba(18, 19, 27, 0.82), rgba(10, 11, 16, 0.78));
}

body.profile-page .profile-tab-panel[data-profile-panel="general"] > .profile-panel[hidden] + .profile-panel {
  grid-column: 1 / -1;
}

body.profile-page .profile-panel-head {
  margin-bottom: 20px;
}

body.profile-page .profile-panel-kicker {
  margin-bottom: 7px;
  color: var(--room-accent);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.2em;
}

body.profile-page .profile-panel-head h2,
body.profile-page .profile-list-subhead h3 {
  color: #f9f9fb;
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 880;
  letter-spacing: -0.035em;
}

body.profile-page .profile-panel-description {
  max-width: 500px;
  margin: 7px 0 0;
  color: var(--room-muted);
  font-size: 11px;
  line-height: 1.5;
}

body.profile-page .profile-recent-row-wrap,
body.profile-page .profile-history-row-wrap {
  padding: 0;
}

body.profile-page .profile-history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-height: 326px;
  padding-right: 4px;
  overflow-x: hidden;
  overflow-y: auto;
}

body.profile-page .profile-history-grid::-webkit-scrollbar { width: 4px; }
body.profile-page .profile-history-grid::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(255, 255, 255, 0.16); }

body.profile-page .profile-history-grid .profile-recent-card {
  grid-template-columns: 78px minmax(0, 1fr);
  min-height: 125px;
  padding: 10px;
  gap: 13px;
  border-color: rgba(255, 255, 255, 0.085);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
  backdrop-filter: none;
}

body.profile-page .profile-history-grid .profile-recent-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--room-accent-rgb), 0.28);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

body.profile-page .profile-history-grid .profile-recent-poster-wrap {
  width: 78px;
  height: 105px;
  border-radius: 11px;
}

body.profile-page .profile-history-grid .profile-recent-copy { gap: 5px; }
body.profile-page .profile-history-grid .profile-recent-copy strong { font-size: 14px; }

body.profile-page .profile-favorite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  max-height: 332px;
  padding: 2px 4px 9px 2px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: none;
  align-content: start;
}

body.profile-page .profile-favorite-grid > .profile-empty-panel {
  grid-column: 1 / -1;
}

body.profile-page .profile-favorite-card {
  width: auto;
  min-width: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

body.profile-page .profile-favorite-media {
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.24);
}

body.profile-page .profile-favorite-name {
  margin: 8px 2px 0;
  color: #f5f5f8;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.25;
}

body.profile-page .profile-favorite-card:hover,
body.profile-page .profile-favorite-card:focus-within { transform: translateY(-5px); }

body.profile-page .profile-favorite-card:hover .profile-favorite-image,
body.profile-page .profile-favorite-card:focus-within .profile-favorite-image {
  transform: scale(1.04);
}

body.profile-page .profile-favorite-badge {
  left: 8px;
  bottom: 8px;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 850;
}

body.profile-page .profile-row-nav { display: none; }

body.profile-page .profile-empty-panel.profile-section-empty {
  position: relative;
  min-height: 230px;
  padding: 80px 24px 24px;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.018);
}

body.profile-page .profile-empty-panel.profile-section-empty::before {
  content: "";
  position: absolute;
  top: 42px;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(var(--room-accent-rgb), 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--room-accent-rgb), 0.22), transparent 64%);
  box-shadow: 0 0 0 9px rgba(var(--room-accent-2-rgb), 0.025);
  transform: translateX(-50%);
}

body.profile-page .profile-empty-panel.profile-section-empty p {
  color: rgba(255, 255, 255, 0.46);
  font-size: 12px;
}

/* Secondary rooms */
body.profile-page .profile-tab-panel[data-profile-panel="lists"] > .profile-panel,
body.profile-page .profile-tab-panel[data-profile-panel="stats"] > .profile-panel,
body.profile-page .profile-tab-panel[data-profile-panel="reviews"] > .profile-panel,
body.profile-page .profile-private-notice {
  margin-top: 18px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--room-line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(18, 19, 26, 0.88), rgba(9, 10, 15, 0.84));
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.035);
}

body.profile-page .profile-list-subhead {
  justify-content: space-between;
  margin-bottom: 16px;
}

body.profile-page .profile-list-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--room-accent);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

body.profile-page .profile-list-add-btn {
  width: 40px;
  height: 40px;
  border-color: rgba(var(--room-accent-rgb), 0.22);
  border-radius: 12px;
  background: rgba(var(--room-accent-2-rgb), 0.08);
}

body.profile-page .profile-stats-chart-card,
body.profile-page .profile-stats-donut-card,
body.profile-page .profile-review-card {
  border-color: rgba(255, 255, 255, 0.085);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
}

body.profile-page .profile-list-card,
body.profile-page .profile-list-copy {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body.profile-page .profile-reviews-headline {
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
}

body.profile-page .profile-history-section {
  --profile-history-accent: var(--room-accent);
  --profile-history-accent-soft: rgba(var(--room-accent-2-rgb), 0.16);
}

body.profile-page .profile-history-head .profile-panel-kicker {
  color: var(--room-accent);
}

body.profile-page .profile-history-toggle:hover,
body.profile-page .profile-history-toggle:focus-visible {
  border-color: rgba(var(--room-accent-rgb), 0.36);
  background: rgba(var(--room-accent-2-rgb), 0.1);
}

body.profile-page .profile-history-grid .profile-recent-card::before {
  background: radial-gradient(circle at 0 0, rgba(var(--room-accent-rgb), 0.15), transparent 48%);
}

body.profile-page .profile-history-grid .profile-recent-card:first-child {
  border-color: rgba(var(--room-accent-rgb), 0.24);
}

body.profile-page .profile-history-grid .profile-recent-badge {
  border-color: rgba(var(--room-accent-rgb), 0.26);
  color: var(--room-accent);
  background: rgba(var(--room-accent-2-rgb), 0.13);
}

body.profile-page .profile-recent-progress i {
  background: linear-gradient(90deg, var(--room-accent), var(--room-accent-2));
  box-shadow: 0 0 12px rgba(var(--room-accent-2-rgb), 0.36);
}

body.profile-page .profile-private-notice-icon {
  border-color: rgba(var(--room-accent-rgb), 0.22);
  color: var(--room-accent);
  background: rgba(var(--room-accent-2-rgb), 0.1);
}

/* Normal profile / cinematic background preview switch */
body.profile-page .profile-room-hero,
body.profile-page .profile-room-hero::before,
body.profile-page .profile-summary-banner,
body.profile-page .profile-banner-shell,
body.profile-page .profile-header,
body.profile-page .profile-header-copy,
body.profile-page .profile-stats-standalone,
body.profile-page .profile-overview .profile-section-tabs,
body.profile-page .profile-tab-panel.is-active,
body.profile-page > .footer {
  transition:
    opacity 0.48s ease,
    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.42s ease,
    background-color 0.42s ease,
    box-shadow 0.42s ease,
    filter 0.62s ease;
}

body.profile-page .profile-stats-standalone { max-height: 180px; }
body.profile-page .profile-overview .profile-section-tabs { max-height: 74px; }
body.profile-page .profile-tab-panel.is-active { max-height: 2600px; }

body.profile-page .profile-view-switch-wrap {
  position: relative;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  margin: 12px 2px 0;
  transition: margin 0.72s cubic-bezier(0.22, 1, 0.36, 1), transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

body.profile-page .profile-view-toggle {
  min-width: 126px;
  min-height: 44px;
  padding: 5px 12px 5px 6px;
  display: grid;
  grid-template-columns: 32px max-content;
  align-items: center;
  justify-content: start;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  color: #f8f8fb;
  background: rgba(11, 12, 17, 0.76);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.profile-page .profile-view-toggle:hover,
body.profile-page .profile-view-toggle:focus-visible {
  border-color: rgba(var(--room-accent-rgb), 0.3);
  background: rgba(27, 14, 14, 0.86);
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.28), 0 0 24px rgba(var(--room-accent-2-rgb), 0.08);
  transform: translateY(-1px);
}

body.profile-page .profile-view-toggle:focus-visible {
  outline: 2px solid rgba(var(--room-accent-rgb), 0.48);
  outline-offset: 3px;
}

body.profile-page .profile-view-toggle-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--room-accent-rgb), 0.2);
  border-radius: 11px;
  background: rgba(var(--room-accent-2-rgb), 0.09);
}

body.profile-page .profile-view-toggle-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.82;
  filter: grayscale(1) brightness(2.2);
}

body.profile-page .profile-view-toggle-copy {
  min-width: 0;
  display: flex;
  align-items: center;
}

body.profile-page .profile-view-toggle-copy strong {
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
}

body.profile-page.is-profile-preview .profile-page-backdrop.has-image {
  opacity: 0.96;
  filter: blur(8px) saturate(1.06);
  transform: scale(1.025);
}

body.profile-page.is-profile-preview .profile-page-backdrop.has-image.is-custom-background,
body.profile-page.is-profile-preview.has-profile-motion-background .profile-page-backdrop.has-image.is-custom-background {
  opacity: 1;
  filter: none;
  transform: scale(1.005);
}

body.profile-page.is-profile-preview .profile-page-backdrop::before,
body.profile-page.is-profile-preview.has-profile-motion-background .profile-page-backdrop::before {
  background:
    radial-gradient(circle at 50% 44%, rgba(8, 9, 13, 0.02), rgba(8, 9, 13, 0.16) 64%, rgba(8, 9, 13, 0.34) 100%),
    linear-gradient(180deg, rgba(6, 7, 10, 0.12), rgba(6, 7, 10, 0.28));
}

body.profile-page.is-profile-preview .profile-shell {
  min-height: calc(100vh - 104px);
}

body.profile-page.is-profile-preview .profile-room-hero {
  overflow: visible;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body.profile-page.is-profile-preview .profile-room-hero::before {
  opacity: 0;
  transform: scale(0.76);
}

body.profile-page.is-profile-preview .profile-summary-banner {
  padding-top: 116px;
}

body.profile-page.is-profile-preview .profile-banner-shell {
  height: 0 !important;
  opacity: 0;
  border-color: transparent;
  transform: translateY(-24px) scale(0.97);
  filter: blur(8px);
  pointer-events: none;
}

body.profile-page.is-profile-preview .profile-header {
  width: min(920px, calc(100% - 64px));
  margin: 0 auto !important;
  padding: 30px 32px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(10, 11, 16, 0.48), rgba(10, 11, 16, 0.22));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.profile-page.is-profile-preview .profile-header-copy {
  padding-top: 0;
}

body.profile-page.is-profile-preview .profile-summary-bio {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(7, 8, 12, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.profile-page.is-profile-preview .profile-stats-standalone {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-color: transparent;
  transform: translateY(16px) scale(0.985);
  overflow: hidden;
  pointer-events: none;
}

body.profile-page.is-profile-preview .profile-view-switch-wrap {
  margin-top: 18px;
  transform: translateX(-2px);
}

body.profile-page.is-profile-preview .profile-view-toggle {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(7, 8, 12, 0.42);
}

body.profile-page.is-profile-preview .profile-view-toggle-icon {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
}

body.profile-page.is-profile-preview .profile-overview .profile-section-tabs {
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-color: transparent;
  transform: translateY(18px) scale(0.985);
  overflow: hidden;
  pointer-events: none;
}

body.profile-page.is-profile-preview .profile-tab-panel.is-active {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  overflow: hidden;
  pointer-events: none;
}

body.profile-page.is-profile-preview > .footer {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

body.profile-page.is-profile-view-switching .profile-view-toggle {
  pointer-events: none;
}

@media (max-width: 980px) {
  body.profile-page .profile-stats-standalone {
    grid-template-columns: minmax(250px, 1.2fr) repeat(3, minmax(105px, 0.65fr));
    padding-inline: 18px;
  }

  body.profile-page .profile-level-card { padding-right: 16px; }
  body.profile-page .profile-stat-box { padding-inline: 10px; }
  body.profile-page .profile-stat-icon { display: none; }

  body.profile-page .profile-tab-panel.is-active[data-profile-panel="general"] {
    grid-template-columns: minmax(0, 1fr);
  }

  body.profile-page .profile-tab-panel[data-profile-panel="general"] > .profile-panel {
    min-height: auto;
  }

  body.profile-page .profile-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  body.profile-page .profile-favorite-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    max-height: none;
  }
}

@media (max-width: 700px) {
  body.profile-page .profile-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    max-height: 460px;
  }
}

/* Continue watching as poster-first anime cards */
body.profile-page .profile-history-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  max-height: 340px;
  padding: 2px 4px 10px 2px;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
}

body.profile-page .profile-history-grid .profile-recent-anime-card {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

body.profile-page .profile-history-grid .profile-recent-anime-card::before { display: none; }

body.profile-page .profile-history-grid .profile-recent-anime-card:first-child {
  border-color: transparent;
}

body.profile-page .profile-history-grid .profile-recent-anime-card:hover,
body.profile-page .profile-history-grid .profile-recent-anime-card:focus-visible {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  filter: none;
  transform: translateY(-5px);
}

body.profile-page .profile-history-grid .profile-recent-anime-card .profile-recent-poster-wrap {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.24);
  transition: border-color 0.25s ease, box-shadow 0.28s ease, filter 0.28s ease;
}

body.profile-page .profile-history-grid .profile-recent-anime-card .profile-recent-poster-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(5, 6, 9, 0.28));
}

body.profile-page .profile-history-grid .profile-recent-anime-card:hover .profile-recent-poster-wrap,
body.profile-page .profile-history-grid .profile-recent-anime-card:focus-visible .profile-recent-poster-wrap {
  border-color: rgba(var(--room-accent-rgb), 0.4);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32), 0 0 22px rgba(var(--room-accent-2-rgb), 0.1);
  filter: brightness(1.045);
}

body.profile-page .profile-history-grid .profile-recent-anime-card .profile-recent-poster {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

body.profile-page .profile-history-grid .profile-recent-anime-card:hover .profile-recent-poster,
body.profile-page .profile-history-grid .profile-recent-anime-card:focus-visible .profile-recent-poster {
  transform: scale(1.04);
}

body.profile-page .profile-history-grid .profile-recent-anime-copy {
  min-width: 0;
  margin: 9px 2px 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

body.profile-page .profile-history-grid .profile-recent-anime-copy strong {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: #f7f7fa;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.profile-page .profile-history-grid .profile-recent-anime-copy small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
}

body.profile-page .profile-history-grid .profile-recent-anime-copy small b {
  color: var(--room-accent);
  font-size: inherit;
  font-weight: 900;
}

@media (max-width: 900px) {
  body.profile-page .profile-history-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.profile-page .profile-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    max-height: 460px;
  }

  body.profile-page .profile-history-grid .profile-recent-anime-card .profile-recent-poster-wrap {
    border-radius: 13px;
  }

  body.profile-page .profile-history-grid .profile-recent-anime-copy strong { font-size: 11px; }
}

@media (max-width: 700px) {
  body.profile-page {
    padding-top: 0;
  }

  body.profile-page .profile-shell {
    width: 100%;
    padding-bottom: 86px;
  }

  body.profile-page .profile-room-hero {
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  }

  body.profile-page .profile-banner-shell {
    height: 250px;
  }

  body.profile-page .profile-banner-content {
    padding: 84px 16px 18px;
  }

  body.profile-page .profile-header {
    width: auto;
    margin: -49px 16px 0;
    padding-bottom: 20px;
    grid-template-columns: 98px minmax(0, 1fr) !important;
    column-gap: 11px !important;
    row-gap: 12px !important;
  }

  body.profile-page .profile-header-avatar { margin-top: 0; }

  body.profile-page .profile-avatar-upload-hero {
    width: 98px;
    height: 98px;
  }

  body.profile-page .profile-avatar-hero { border-width: 5px; }
  body.profile-page .profile-presence { min-width: 68px; padding: 5px 8px; font-size: 8px; }

  body.profile-page .profile-main-meta {
    padding: 50px 2px 0 0 !important;
  }

  body.profile-page .profile-name-row h1 {
    font-size: clamp(24px, 7.3vw, 31px);
  }

  body.profile-page .profile-edit-chip {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  body.profile-page .profile-submeta-row {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 5px 8px;
  }

  body.profile-page .profile-kaiyocoin {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 2px;
  }

  body.profile-page .profile-role-tags {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-basis: 100%;
    flex-wrap: wrap;
  }

  body.profile-page .profile-bio-block {
    margin-top: 1px;
  }

  body.profile-page .profile-summary-bio {
    min-height: 0;
    padding: 12px 13px;
    border-radius: 12px;
    font-size: 12px;
  }

  body.profile-page .profile-stats-standalone {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    padding: 14px 12px 16px;
    overflow: hidden;
  }

  body.profile-page .profile-level-card {
    grid-column: 1 / -1;
    min-height: 66px;
    margin-bottom: 9px;
    padding: 5px 7px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  body.profile-page .profile-level-orbit {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    font-size: 17px;
  }

  body.profile-page .profile-stat-box {
    width: auto !important;
    min-width: 0 !important;
    min-height: 60px;
    padding: 8px 4px;
  }

  body.profile-page .profile-stat-copy { justify-items: center; text-align: center; }
  body.profile-page .profile-stat-box strong { font-size: 18px; }
  body.profile-page .profile-stat-label { font-size: 8px; }

  body.profile-page .profile-overview .profile-section-tabs {
    position: relative;
    width: calc(100% - 20px) !important;
    min-width: 0 !important;
    max-width: calc(100% - 20px) !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    margin: 12px 10px 0;
    gap: 2px;
    padding: 4px;
    border-radius: 15px;
  }

  body.profile-page .profile-overview .profile-section-tab {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 45px;
    gap: 6px;
    padding: 0 5px;
    border-radius: 11px;
    font-size: 10px;
  }

  body.profile-page .profile-overview .profile-section-tab-icon,
  body.profile-page .profile-overview .profile-section-tab-icon-image {
    width: 14px;
    height: 14px;
  }

  body.profile-page .profile-tab-panel.is-active[data-profile-panel="general"] {
    display: grid;
    gap: 12px;
    padding: 0 10px;
  }

  body.profile-page .profile-tab-panel[data-profile-panel="general"] > .profile-panel {
    margin-top: 12px;
    padding: 18px 15px;
    border-radius: 18px;
  }

  body.profile-page .profile-tab-panel[data-profile-panel="general"] > .profile-panel + .profile-panel {
    margin-top: 0;
  }

  body.profile-page .profile-panel-head { margin-bottom: 15px; }
  body.profile-page .profile-panel-head h2 { font-size: 20px; }

  body.profile-page .profile-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    max-height: 460px;
  }

  body.profile-page .profile-favorite-grid {
    display: flex;
    gap: 11px;
    margin-right: -15px;
    padding: 0 15px 5px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }

  body.profile-page .profile-panel[aria-labelledby="profile-favorite-title"] .profile-row-nav {
    display: none !important;
  }

  body.profile-page .profile-favorite-card {
    flex: 0 0 126px;
    scroll-snap-align: start;
  }

  body.profile-page .profile-empty-panel.profile-section-empty {
    flex: 0 0 100%;
    min-height: 180px;
  }

  body.profile-page .profile-tab-panel[data-profile-panel="lists"],
  body.profile-page .profile-tab-panel[data-profile-panel="stats"],
  body.profile-page .profile-tab-panel[data-profile-panel="reviews"] {
    padding: 0 10px;
  }

  body.profile-page .profile-tab-panel[data-profile-panel="lists"] > .profile-panel,
  body.profile-page .profile-tab-panel[data-profile-panel="stats"] > .profile-panel,
  body.profile-page .profile-tab-panel[data-profile-panel="reviews"] > .profile-panel,
  body.profile-page .profile-private-notice {
    margin-top: 12px;
    padding: 20px 15px;
    border-radius: 18px;
  }

  body.profile-page.is-profile-preview .profile-shell {
    min-height: calc(100dvh - 76px);
  }

  body.profile-page.is-profile-preview .profile-summary-banner {
    padding-top: 86px;
  }

  body.profile-page.is-profile-preview .profile-header {
    width: calc(100% - 24px);
    margin: 0 12px !important;
    padding: 22px 14px 20px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(10, 11, 16, 0.54), rgba(10, 11, 16, 0.24));
  }

  body.profile-page.is-profile-preview .profile-main-meta {
    padding-top: 44px !important;
  }

  body.profile-page .profile-view-switch-wrap,
  body.profile-page.is-profile-preview .profile-view-switch-wrap {
    width: calc(100% - 20px);
    margin: 10px 10px 0;
    transform: none;
  }

  body.profile-page .profile-view-toggle {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 410px) {
  body.profile-page .profile-banner-shell { height: 226px; }
  body.profile-page .profile-banner-content { padding-top: 75px; }
  body.profile-page .profile-header { grid-template-columns: 90px minmax(0, 1fr) !important; }
  body.profile-page .profile-avatar-upload-hero { width: 90px; height: 90px; }
  body.profile-page .profile-main-meta { padding-top: 46px !important; }
  body.profile-page .profile-overview .profile-section-tab { font-size: 0; }
  body.profile-page .profile-overview .profile-section-tab-icon,
  body.profile-page .profile-overview .profile-section-tab-icon-image { width: 18px; height: 18px; }
  body.profile-page .profile-overview .profile-section-tab-text { font-size: 0; }
  body.profile-page .profile-overview .profile-section-tab-text::first-letter { font-size: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.profile-page .profile-level-progress i { transition: none; }
}

/* --------------------------------------------------------------------------
   Profile Studio — rebuilt editor
   -------------------------------------------------------------------------- */
body.profile-page #profile-edit-modal {
  display: grid;
  place-items: center;
  padding: 20px;
}

body.profile-page #profile-edit-modal[hidden] { display: none; }

body.profile-page #profile-edit-modal .profile-edit-backdrop {
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(14px) saturate(0.82);
  -webkit-backdrop-filter: blur(14px) saturate(0.82);
}

body.profile-page #profile-edit-modal .profile-edit-dialog--profile {
  width: min(1180px, 100%);
  height: min(860px, calc(100dvh - 40px));
  max-height: none;
  margin: 0;
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 28px;
  background: #0b0c10;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.68), inset 0 1px rgba(255, 255, 255, 0.035);
  transform: translateY(22px) scale(0.965);
  filter: blur(5px);
  transition: opacity 0.28s ease, transform 0.48s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

body.profile-page #profile-edit-modal.is-open .profile-edit-dialog--profile {
  transform: none;
  filter: none;
}

body.profile-page #profile-edit-modal .profile-edit-head {
  min-height: 0;
  padding: 17px 22px 17px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(13, 14, 19, 0.98);
  backdrop-filter: none;
}

body.profile-page .profile-studio-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

body.profile-page #profile-edit-modal .profile-edit-title-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(var(--room-accent-rgb), 0.26);
  border-radius: 14px;
  background: radial-gradient(circle, rgba(var(--room-accent-rgb), 0.25), rgba(var(--room-accent-2-rgb), 0.07));
  transform: none;
}

body.profile-page #profile-edit-modal .profile-edit-title-icon::before,
body.profile-page #profile-edit-modal .profile-edit-title-icon::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--room-accent);
  transform: rotate(45deg);
}

body.profile-page #profile-edit-modal .profile-edit-title-icon::after {
  inset: 17px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff;
}

body.profile-page .profile-studio-title > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.profile-page .profile-studio-kicker {
  color: var(--room-accent);
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.18em;
}

body.profile-page #profile-edit-modal .profile-edit-head h2 {
  margin: 0;
  display: block;
  color: #fafafd;
  font-size: 22px;
  font-weight: 880;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

body.profile-page .profile-studio-title p {
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  line-height: 1.2;
}

body.profile-page #profile-edit-modal .profile-editor-save-state {
  order: initial;
  margin-left: auto;
  min-height: 30px;
  padding: 0 11px;
  border-color: rgba(255, 255, 255, 0.075);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.43);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  font-weight: 800;
}

body.profile-page #profile-edit-modal .profile-editor-save-state::before {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.025);
}

body.profile-page #profile-edit-modal.is-dirty .profile-editor-save-state {
  border-color: rgba(var(--room-accent-rgb), 0.22);
  color: var(--room-accent);
  background: rgba(var(--room-accent-2-rgb), 0.055);
}

body.profile-page #profile-edit-modal .profile-edit-close {
  order: initial;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.035);
  font-size: 22px;
}

body.profile-page #profile-edit-modal .profile-edit-close:hover {
  border-color: rgba(var(--room-accent-rgb), 0.26);
  color: #fff;
  background: rgba(var(--room-accent-2-rgb), 0.08);
}

body.profile-page #profile-edit-modal .profile-edit-form {
  height: 100%;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto 76px;
  overflow: hidden;
}

body.profile-page #profile-edit-modal .profile-editor-layout {
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(410px, 0.88fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
}

body.profile-page #profile-edit-modal .profile-editor-preview {
  position: relative !important;
  top: auto !important;
  min-width: 0;
  height: 100%;
  padding: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 13px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(var(--room-accent-rgb), 0.075), transparent 32%),
    #090a0e;
  box-shadow: none;
}

body.profile-page .profile-studio-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.profile-page .profile-studio-preview-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.16em;
}

body.profile-page .profile-studio-preview-head i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #62e6a2;
  box-shadow: 0 0 10px rgba(98, 230, 162, 0.7);
}

body.profile-page .profile-studio-preview-head small {
  color: rgba(255, 255, 255, 0.32);
  font-size: 9px;
}

body.profile-page .profile-studio-preview-stage {
  position: relative;
  isolation: isolate;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 76% 22%, rgba(var(--room-accent-rgb), 0.34), transparent 34%),
    linear-gradient(145deg, #2b1111, #0b0d16 58%, #1d0b0b);
  background-position: center;
  background-size: cover;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.045);
}

body.profile-page .profile-studio-preview-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(6, 7, 11, 0.04), rgba(6, 7, 11, 0.62)),
    radial-gradient(circle at 15% 15%, transparent, rgba(7, 8, 12, 0.28) 74%);
  pointer-events: none;
}

body.profile-page #profile-edit-modal .profile-editor-preview-banner {
  position: relative;
  height: clamp(190px, 27vh, 250px);
  flex: 0 0 auto;
  margin: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 75% 32%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.5px),
    linear-gradient(120deg, var(--room-accent), var(--room-accent-2));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

body.profile-page #profile-edit-modal .profile-editor-preview-banner::after {
  background: linear-gradient(180deg, rgba(7, 8, 12, 0.04), rgba(7, 8, 12, 0.48));
}

body.profile-page #profile-edit-modal .profile-editor-preview-banner > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.profile-page .profile-studio-preview-badge {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 13px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(7, 8, 12, 0.42);
  backdrop-filter: blur(10px);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.14em;
}

body.profile-page .profile-studio-preview-identity {
  position: relative;
  z-index: 3;
  min-width: 0;
  margin: -54px 28px 0;
  display: flex;
  align-items: flex-end;
  gap: 15px;
}

body.profile-page #profile-edit-modal .profile-editor-preview-avatar {
  position: relative;
  left: auto;
  bottom: auto;
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  border: 6px solid #0c0d12;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

body.profile-page #profile-edit-modal .profile-editor-preview-copy {
  min-width: 0;
  padding: 0 0 8px;
  display: grid;
  gap: 4px;
}

body.profile-page #profile-edit-modal .profile-editor-preview-kicker {
  color: var(--room-accent);
  font-size: 7px;
  letter-spacing: 0.17em;
}

body.profile-page #profile-edit-modal .profile-editor-preview-copy strong {
  color: #fff;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 900;
  letter-spacing: -0.045em;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body.profile-page #profile-edit-modal .profile-editor-preview-copy small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

body.profile-page .profile-studio-preview-bio {
  position: relative;
  z-index: 3;
  min-height: 54px;
  margin: 17px 28px 24px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(7, 8, 12, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.profile-page #profile-edit-modal .profile-editor-preview-note {
  margin: 0;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.34);
  background: none;
  font-size: 9px;
}

body.profile-page #profile-edit-modal .profile-editor-preview-note span {
  color: var(--room-accent);
}

body.profile-page #profile-edit-modal .profile-editor-fields {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 100%;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  background: #0d0e12;
}

body.profile-page #profile-edit-modal .profile-editor-fields::-webkit-scrollbar { width: 5px; }
body.profile-page #profile-edit-modal .profile-editor-fields::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(255, 255, 255, 0.14); }

body.profile-page .profile-studio-control-card {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.022);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

body.profile-page .profile-studio-control-card + .profile-studio-control-card {
  margin-top: 14px;
}

body.profile-page .profile-studio-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

body.profile-page .profile-studio-section-number {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--room-accent-rgb), 0.2);
  border-radius: 10px;
  color: var(--room-accent);
  background: rgba(var(--room-accent-2-rgb), 0.065);
  font-size: 9px;
  font-weight: 950;
}

body.profile-page .profile-studio-section-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body.profile-page .profile-studio-section-head h3 {
  margin: 0;
  color: #f7f7fa;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

body.profile-page .profile-studio-section-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
  line-height: 1.2;
}

body.profile-page #profile-edit-modal .profile-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.profile-page #profile-edit-modal .profile-edit-field {
  position: relative;
  gap: 7px;
  margin: 0;
}

body.profile-page #profile-edit-modal .profile-edit-field > span {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: none;
}

body.profile-page #profile-edit-modal .profile-edit-field input,
body.profile-page #profile-edit-modal .profile-edit-field textarea,
body.profile-page #profile-edit-modal #profile-edit-bio {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 12px;
  outline: 0;
  color: #f7f7fa;
  background: #08090c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.32);
  font: 600 12px/1.45 "Segoe UI", sans-serif;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.profile-page #profile-edit-modal .profile-edit-field input {
  height: 46px;
  padding: 0 13px;
}

body.profile-page #profile-edit-modal .profile-edit-field textarea,
body.profile-page #profile-edit-modal #profile-edit-bio {
  min-height: 88px;
  height: 88px;
  max-height: 150px;
  padding: 12px 13px 26px;
  resize: vertical;
}

body.profile-page #profile-edit-modal .profile-edit-field input:focus,
body.profile-page #profile-edit-modal .profile-edit-field textarea:focus,
body.profile-page #profile-edit-modal #profile-edit-bio:focus {
  border-color: rgba(var(--room-accent-rgb), 0.52);
  background: #0b0c10;
  box-shadow: 0 0 0 3px rgba(var(--room-accent-2-rgb), 0.08);
}

body.profile-page #profile-edit-modal .profile-studio-bio-field {
  margin-top: 13px;
}

body.profile-page #profile-edit-modal .profile-edit-counter {
  position: absolute;
  right: 11px;
  bottom: 8px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
}

body.profile-page #profile-edit-modal .profile-editor-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.profile-page #profile-edit-modal .profile-editor-media-btn {
  position: relative;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

body.profile-page #profile-edit-modal .profile-editor-media-btn:hover,
body.profile-page #profile-edit-modal .profile-editor-media-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(var(--room-accent-rgb), 0.28);
  background: rgba(var(--room-accent-2-rgb), 0.055);
  box-shadow: none;
  outline: none;
}

body.profile-page #profile-edit-modal .profile-editor-media-btn--premium {
  grid-column: 1 / -1;
  background: linear-gradient(115deg, rgba(244, 196, 82, 0.055), rgba(255, 255, 255, 0.018) 58%);
}

body.profile-page #profile-edit-modal .profile-editor-media-icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(var(--room-accent-rgb), 0.17);
  border-radius: 12px;
  background: rgba(var(--room-accent-2-rgb), 0.075);
}

body.profile-page #profile-edit-modal .profile-editor-media-icon img {
  width: 15px;
  height: 15px;
}

body.profile-page #profile-edit-modal .profile-editor-media-icon--premium {
  color: #efc45e;
  border-color: rgba(244, 196, 82, 0.18);
  background: rgba(244, 196, 82, 0.075);
}

body.profile-page #profile-edit-modal .profile-editor-media-copy {
  grid-column: 2;
  grid-row: 1 / 3;
  padding-right: 4px;
  gap: 4px;
}

body.profile-page #profile-edit-modal .profile-editor-media-copy strong {
  color: #f8f8fb;
  font-size: 11px;
  font-weight: 850;
}

body.profile-page #profile-edit-modal .profile-editor-media-copy small {
  color: rgba(255, 255, 255, 0.35);
  font-size: 8px;
  line-height: 1.25;
  white-space: normal;
}

body.profile-page #profile-edit-modal .profile-premium-mini {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  padding: 3px 4px;
  border-color: rgba(239, 196, 94, 0.14);
  border-radius: 4px;
  color: rgba(243, 204, 110, 0.72);
  background: rgba(239, 196, 94, 0.045);
  font-size: 6px;
}

body.profile-page #profile-edit-modal .profile-premium-media-note {
  margin: 10px 0 0;
  padding: 9px 10px;
  display: flex;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.39);
  background: rgba(244, 196, 82, 0.035);
  font-size: 8px;
}

body.profile-page #profile-edit-modal .profile-premium-media-note a {
  margin-left: auto;
  color: #e9c76e;
  font-weight: 850;
  text-decoration: none;
}

body.profile-page .profile-studio-media-manager {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.016);
}

body.profile-page .profile-studio-media-manager summary {
  min-height: 58px;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

body.profile-page .profile-studio-media-manager summary::-webkit-details-marker { display: none; }

body.profile-page .profile-studio-media-manager-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--room-accent-2-rgb), 0.06);
}

body.profile-page .profile-studio-media-manager-icon img {
  width: 13px;
  height: 13px;
  opacity: 0.55;
  filter: brightness(0) saturate(100%) invert(62%) sepia(51%) saturate(1020%) hue-rotate(306deg) brightness(104%);
}

body.profile-page .profile-studio-media-manager summary > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

body.profile-page .profile-studio-media-manager summary strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

body.profile-page .profile-studio-media-manager summary small {
  color: rgba(255, 255, 255, 0.31);
  font-size: 8px;
}

body.profile-page .profile-studio-media-manager summary > i {
  color: rgba(255, 255, 255, 0.35);
  font-size: 15px;
  font-style: normal;
  text-align: center;
  transition: transform 0.24s ease;
}

body.profile-page .profile-studio-media-manager[open] summary > i { transform: rotate(180deg); }

body.profile-page #profile-edit-modal .profile-studio-media-manager .profile-edit-tools {
  margin: 0;
  padding: 0 10px 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.profile-page #profile-edit-modal .profile-danger-btn {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(var(--room-accent-rgb), 0.14);
  border-radius: 10px;
  color: var(--room-accent);
  background: rgba(var(--room-accent-2-rgb), 0.045);
  box-shadow: none;
  font-size: 8px;
}

body.profile-page #profile-edit-modal .profile-danger-btn img {
  width: 11px;
  height: 11px;
}

body.profile-page #profile-edit-modal .profile-edit-status {
  margin: 0;
  padding: 9px 24px;
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(69, 203, 129, 0.05);
  font-size: 10px;
}

body.profile-page #profile-edit-modal .profile-edit-status.is-error {
  border-color: rgba(var(--room-accent-rgb), 0.2);
  background: rgba(var(--room-accent-2-rgb), 0.07);
}

body.profile-page #profile-edit-modal .profile-edit-actions {
  position: relative;
  min-height: 76px;
  margin: 0;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: #101116;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.22);
}

body.profile-page #profile-edit-modal .profile-edit-actions > p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 9px;
}

body.profile-page #profile-edit-modal .profile-edit-actions > p span {
  color: var(--room-accent);
  font-size: 6px;
  text-shadow: 0 0 8px rgba(var(--room-accent-2-rgb), 0.5);
}

body.profile-page #profile-edit-modal .profile-edit-actions > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

body.profile-page #profile-edit-modal .profile-edit-actions .profile-secondary-btn,
body.profile-page #profile-edit-modal .profile-edit-actions .profile-primary-btn {
  width: auto;
  min-width: 104px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 850;
}

body.profile-page #profile-edit-modal .profile-edit-actions .profile-secondary-btn {
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: rgba(255, 255, 255, 0.66) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

body.profile-page #profile-edit-modal .profile-edit-actions .profile-primary-btn {
  min-width: 158px;
  border-color: rgba(var(--room-accent-rgb), 0.34) !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--room-accent), var(--room-accent-2)) !important;
  box-shadow: 0 10px 24px rgba(var(--room-accent-2-rgb), 0.24) !important;
}

@media (max-width: 900px) {
  body.profile-page #profile-edit-modal { padding: 10px; }

  body.profile-page #profile-edit-modal .profile-edit-dialog--profile {
    width: min(720px, 100%);
    height: calc(100dvh - 20px);
    grid-template-rows: 82px minmax(0, 1fr);
    border-radius: 22px;
  }

  body.profile-page #profile-edit-modal .profile-editor-layout {
    display: block;
    overflow-y: auto;
  }

  body.profile-page #profile-edit-modal .profile-editor-preview {
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  }

  body.profile-page .profile-studio-preview-stage { min-height: 480px; }

  body.profile-page #profile-edit-modal .profile-editor-fields {
    height: auto;
    padding: 18px;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  body.profile-page #profile-edit-modal { padding: 0; }

  body.profile-page #profile-edit-modal .profile-edit-dialog--profile {
    width: 100%;
    height: 100%;
    min-height: 100%;
    grid-template-rows: 70px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
  }

  body.profile-page #profile-edit-modal .profile-edit-head {
    padding: 10px 12px 10px 15px;
    gap: 9px;
  }

  body.profile-page #profile-edit-modal .profile-edit-title-icon {
    display: block;
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 11px;
  }

  body.profile-page #profile-edit-modal .profile-edit-title-icon::before { inset: 8px; }
  body.profile-page #profile-edit-modal .profile-edit-title-icon::after { inset: 14px; }
  body.profile-page .profile-studio-kicker { display: none; }
  body.profile-page #profile-edit-modal .profile-edit-head h2 { font-size: 17px; }
  body.profile-page .profile-studio-title p { display: none; }
  body.profile-page #profile-edit-modal .profile-editor-save-state { display: none; }

  body.profile-page #profile-edit-modal .profile-edit-close {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    margin-left: auto;
  }

  body.profile-page #profile-edit-modal .profile-edit-form {
    grid-template-rows: minmax(0, 1fr) auto 70px;
  }

  body.profile-page #profile-edit-modal .profile-editor-preview {
    padding: 13px;
    gap: 10px;
  }

  body.profile-page .profile-studio-preview-head small,
  body.profile-page #profile-edit-modal .profile-editor-preview-note { display: none; }
  body.profile-page .profile-studio-preview-stage { min-height: 390px; border-radius: 20px; }

  body.profile-page #profile-edit-modal .profile-editor-preview-banner {
    height: 165px;
    margin: 10px;
    border-radius: 15px;
  }

  body.profile-page .profile-studio-preview-identity {
    margin: -44px 17px 0;
    gap: 11px;
  }

  body.profile-page #profile-edit-modal .profile-editor-preview-avatar {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
    border-width: 5px;
  }

  body.profile-page #profile-edit-modal .profile-editor-preview-copy strong { font-size: 24px; }

  body.profile-page .profile-studio-preview-bio {
    min-height: 48px;
    margin: 13px 17px 18px;
    padding: 11px 12px;
    font-size: 10px;
  }

  body.profile-page #profile-edit-modal .profile-editor-fields { padding: 13px; }
  body.profile-page .profile-studio-control-card { padding: 15px; border-radius: 17px; }
  body.profile-page #profile-edit-modal .profile-edit-grid { grid-template-columns: 1fr; }
  body.profile-page #profile-edit-modal .profile-edit-field + .profile-edit-field { margin-top: 11px; }
  body.profile-page #profile-edit-modal .profile-editor-media-grid { grid-template-columns: 1fr; }
  body.profile-page #profile-edit-modal .profile-editor-media-btn--premium { grid-column: auto; }

  body.profile-page #profile-edit-modal .profile-studio-media-manager .profile-edit-tools {
    grid-template-columns: 1fr;
  }

  body.profile-page #profile-edit-modal .profile-edit-actions {
    min-height: 70px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  body.profile-page #profile-edit-modal .profile-edit-actions > p { display: none; }
  body.profile-page #profile-edit-modal .profile-edit-actions > div { width: 100%; }

  body.profile-page #profile-edit-modal .profile-edit-actions .profile-secondary-btn,
  body.profile-page #profile-edit-modal .profile-edit-actions .profile-primary-btn {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 10px;
  }

  body.profile-page #profile-edit-modal .profile-edit-actions .profile-primary-btn { flex-grow: 1.45; }
}

/* --------------------------------------------------------------------------
   Cinematic profile header — banner, identity, bio, then stats
   -------------------------------------------------------------------------- */
body.profile-page.home-page {
  padding-top: 112px !important;
}

body.profile-page .profile-shell {
  padding-top: 22px !important;
}

body.profile-page .profile-room-hero {
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.profile-page .profile-room-hero::before { display: none; }

body.profile-page .profile-summary-banner {
  min-height: 0;
  overflow: visible;
  padding: 0 20px;
  background: transparent;
}

body.profile-page .profile-banner-shell {
  position: relative;
  z-index: 0;
  inset: auto;
  width: calc(100% - 64px);
  height: clamp(300px, 29vw, 380px) !important;
  min-height: 300px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.05);
}

body.profile-page .profile-banner-shell::before { display: none; }

body.profile-page .profile-banner-backdrop::after,
body.profile-page .profile-banner-backdrop.has-image::after {
  background:
    linear-gradient(90deg, rgba(6, 7, 10, 0.42), rgba(6, 7, 10, 0.12) 48%, rgba(6, 7, 10, 0.3)),
    linear-gradient(180deg, rgba(6, 7, 10, 0.18), rgba(6, 7, 10, 0.58) 62%, rgba(6, 7, 10, 0.92));
}

body.profile-page .profile-banner-content {
  z-index: 3;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 18px !important;
}

body.profile-page .profile-banner-pen-wrap {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(8, 9, 13, 0.58);
  backdrop-filter: blur(12px);
}

body.profile-page .profile-banner-overlay {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(8, 9, 13, 0.62);
  backdrop-filter: blur(12px);
}

body.profile-page .profile-header {
  position: relative;
  z-index: 2;
  width: calc(100% - 64px);
  margin: -14px auto 0;
  padding: 0 0 20px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.profile-page .profile-identity-bar {
  position: relative;
  min-width: 0;
  min-height: 96px;
  padding: 13px 17px 13px 132px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: linear-gradient(105deg, rgba(8, 9, 13, 0.9), rgba(8, 9, 13, 0.7));
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.36), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px) saturate(0.88);
  -webkit-backdrop-filter: blur(22px) saturate(0.88);
}

body.profile-page .profile-header-avatar {
  position: absolute;
  z-index: 3;
  left: 18px;
  top: 50%;
  width: 104px;
  margin: 0;
  padding: 0;
  display: block;
  transform: translateY(-62%);
}

body.profile-page .profile-avatar-upload-hero {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 15px 28px rgba(0, 0, 0, 0.4));
}

body.profile-page .profile-avatar-hero {
  border: 4px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 1px rgba(var(--room-accent-rgb), 0.3), 0 15px 34px rgba(0, 0, 0, 0.42);
}

body.profile-page .profile-presence {
  position: absolute;
  z-index: 4;
  left: 50px;
  bottom: -3px;
  min-width: 68px;
  margin: 0;
  padding: 5px 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 9, 13, 0.9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

body.profile-page .profile-header-copy {
  min-width: 0;
  max-width: none;
  padding: 0;
  display: block !important;
}

body.profile-page .profile-identity-inline { display: block !important; }

body.profile-page .profile-main-meta {
  min-width: 0;
  padding: 0 !important;
  display: grid;
  gap: 9px;
}

body.profile-page .profile-name-row {
  min-width: 0;
  align-items: center;
  gap: 10px;
}

body.profile-page .profile-name-row h1 {
  max-width: 100%;
  overflow: hidden;
  padding: 0.14em 0.08em 0.2em 0;
  margin: -0.14em 0 -0.2em;
  font-size: clamp(29px, 3vw, 42px);
  line-height: 1.14;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.profile-page .profile-edit-chip {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
}

body.profile-page .profile-submeta-row {
  min-width: 0;
  align-items: center;
  gap: 9px 13px;
}

body.profile-page .profile-handle,
body.profile-page .profile-member-since {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

body.profile-page .profile-view-switch-wrap {
  position: static;
  z-index: auto;
  width: auto;
  margin: 0;
  display: block;
  transform: none;
}

body.profile-page .profile-view-toggle {
  min-width: 126px;
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

body.profile-page .profile-bio-block {
  position: relative;
  width: min(78%, 880px);
  margin: 0;
  padding: 17px 19px 18px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 19px;
  background: linear-gradient(110deg, rgba(8, 9, 13, 0.86), rgba(8, 9, 13, 0.68));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.profile-page .profile-bio-kicker {
  color: var(--room-accent);
  font-size: 7px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.17em;
}

body.profile-page .profile-summary-bio {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.55;
}

body.profile-page .profile-status {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(69, 203, 129, 0.16);
  border-radius: 9px;
  background: rgba(69, 203, 129, 0.06);
  font-size: 10px;
  line-height: 1.4;
}

body.profile-page .profile-status.is-error {
  border-color: rgba(var(--room-accent-rgb), 0.2);
  background: rgba(var(--room-accent-2-rgb), 0.07);
}

body.profile-page .profile-stats-standalone {
  position: relative;
  z-index: 2;
  width: 100%;
  max-height: 190px;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(255px, 1.35fr) repeat(3, minmax(120px, 0.65fr));
  gap: 9px;
  border: 0;
  background: transparent;
}

body.profile-page .profile-level-card,
body.profile-page .profile-stat-box {
  min-width: 0;
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(8, 9, 13, 0.86), rgba(8, 9, 13, 0.68));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.profile-page .profile-level-card {
  gap: 14px;
  padding: 11px 18px;
}

body.profile-page .profile-level-orbit {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  border-color: rgba(var(--room-accent-rgb), 0.34);
  background:
    radial-gradient(circle at 50% 35%, rgba(var(--room-accent-rgb), 0.12), transparent 70%),
    rgba(255, 255, 255, 0.018);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    0 8px 20px rgba(0, 0, 0, 0.22);
}

body.profile-page .profile-level-orbit::before,
body.profile-page .profile-level-orbit::after {
  display: none;
}

body.profile-page #profile-room-level {
  position: relative;
  z-index: 1;
  display: block;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.profile-page .profile-level-copy strong {
  font-size: 15px;
}

body.profile-page .profile-stat-box {
  padding: 10px 14px;
  justify-content: center;
}

body.profile-page .profile-stat-box:last-child { border-right: 1px solid rgba(255, 255, 255, 0.09); }

body.profile-page .profile-identity-bar,
body.profile-page .profile-bio-block {
  transition: border-color 0.3s ease, background 0.45s ease, transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

body.profile-page.is-profile-preview .profile-summary-banner {
  min-height: 0;
  overflow: visible;
  transform: translateY(-48px);
}

body.profile-page.is-profile-preview .profile-header {
  width: min(920px, calc(100% - 64px));
  margin: 0 auto !important;
  padding: 0;
  gap: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.profile-page.is-profile-preview .profile-identity-bar {
  grid-template-columns: 112px minmax(0, 1fr) auto;
  padding: 15px 17px;
  background: linear-gradient(105deg, rgba(8, 9, 13, 0.68), rgba(8, 9, 13, 0.42));
}

body.profile-page.is-profile-preview .profile-header-avatar {
  position: relative;
  left: auto;
  top: auto;
  width: 112px;
  transform: none;
}

body.profile-page.is-profile-preview .profile-avatar-upload-hero {
  width: 108px;
  height: 108px;
}

body.profile-page.is-profile-preview .profile-presence { left: 54px; }

body.profile-page.is-profile-preview .profile-bio-block {
  width: 100%;
  background: rgba(8, 9, 13, 0.42);
}

body.profile-page.is-profile-preview .profile-summary-bio {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Clean watch-style preview control */
body.profile-page .profile-view-toggle {
  position: relative;
  overflow: hidden;
  min-width: 122px;
  min-height: 52px;
  padding: 0 19px;
  grid-template-columns: 18px max-content;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 13px;
  color: #090a0d;
  background: #f7f7f4;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3), inset 0 -1px rgba(0, 0, 0, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.profile-page .profile-view-toggle::before,
body.profile-page .profile-view-toggle::after { display: none; }

body.profile-page .profile-view-toggle:hover,
body.profile-page .profile-view-toggle:focus-visible {
  border-color: transparent;
  color: #090a0d;
  background: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), 0 0 0 3px rgba(var(--room-accent-rgb), 0.14);
  transform: translateY(-2px) scale(1.015);
}

/* Same full-color shimmer as the settings preview, with an exact seamless cycle. */
body.profile-page .profile-name-row h1.has-premium-name-style[data-name-effect="shimmer"] {
  color: transparent;
  background-image: linear-gradient(
    105deg,
    var(--premium-name-color) 15%,
    var(--premium-name-alt) 38%,
    #fff 50%,
    var(--premium-name-alt) 62%,
    var(--premium-name-color) 85%
  );
  background-size: 220% 100%;
  background-position: 120% 50%;
  background-repeat: repeat-x;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: kaiyoProfileNameSeamlessShimmer 2.7s linear infinite;
}

@keyframes kaiyoProfileNameSeamlessShimmer {
  from { background-position: 120% 50%; }
  to { background-position: -63.333333% 50%; }
}

body.profile-page .profile-view-toggle-icon {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 0;
  color: #090a0d;
  background: transparent;
  box-shadow: none;
}

body.profile-page .profile-view-toggle-fa {
  display: block;
  width: 17px;
  height: 17px;
  color: currentColor;
  fill: currentColor;
}

body.profile-page .profile-view-toggle-fa-back { display: none; }
body.profile-page.is-profile-preview .profile-view-toggle-fa-play { display: none; }
body.profile-page.is-profile-preview .profile-view-toggle-fa-back { display: block; }

body.profile-page .profile-view-toggle-copy strong {
  color: #090a0d;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-shadow: none;
}

body.profile-page.is-profile-preview .profile-view-toggle {
  border-color: transparent;
  color: #090a0d;
  background: #f7f7f4;
}

body.profile-page .profile-view-toggle:active {
  transform: translateY(0) scale(0.97);
}

body.profile-page.is-profile-preview .profile-stats-standalone {
  max-height: 0;
  padding: 0;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
}

@media (max-width: 900px) {
  body.profile-page.home-page { padding-top: 78px !important; }
  body.profile-page .profile-shell { padding-top: 14px !important; }
  body.profile-page .profile-summary-banner { min-height: 0; padding: 0 12px; }
  body.profile-page .profile-banner-shell {
    width: calc(100% - 24px);
    height: clamp(250px, 40vw, 330px) !important;
    min-height: 250px;
    border-radius: 22px;
  }
  body.profile-page .profile-header {
    width: calc(100% - 48px);
    margin-top: -12px;
    padding: 0 0 18px;
  }

  body.profile-page .profile-identity-bar {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 120px;
    gap: 15px;
  }

  body.profile-page .profile-header-avatar { width: 98px; left: 14px; }
  body.profile-page .profile-avatar-upload-hero { width: 94px; height: 94px; }
  body.profile-page .profile-presence { left: 47px; }

  body.profile-page .profile-view-switch-wrap { grid-column: auto; }
  body.profile-page .profile-view-toggle { width: 100%; min-width: 0; }
  body.profile-page .profile-bio-block { width: 100%; }

  body.profile-page .profile-stats-standalone {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.profile-page .profile-level-card {
    grid-column: 1 / -1;
    border-right: 1px solid rgba(255, 255, 255, 0.09);
  }

  body.profile-page .profile-stat-icon { display: none; }
  body.profile-page.is-profile-preview .profile-summary-banner { transform: translateY(-36px); }
}

@media (max-width: 640px) {
  body.profile-page.home-page { padding-top: 72px !important; }
  body.profile-page .profile-shell { padding-top: 10px !important; }
  body.profile-page .profile-shell { width: 100%; }
  body.profile-page .profile-room-hero { border-width: 0 0 1px; border-radius: 0; }
  body.profile-page .profile-summary-banner { min-height: 0; padding: 0 10px; }
  body.profile-page .profile-banner-shell {
    width: 100%;
    height: clamp(205px, 57vw, 260px) !important;
    min-height: 205px;
    border-radius: 18px;
  }
  body.profile-page .profile-header {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: -9px auto 0;
    padding: 0 10px 14px;
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 10px !important;
  }

  body.profile-page .profile-identity-bar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    padding: 13px;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    border-radius: 20px;
  }

  body.profile-page .profile-header-avatar {
    position: relative;
    left: auto;
    top: auto;
    grid-column: auto;
    grid-row: auto;
    width: 86px;
    margin: 0;
    padding: 0 !important;
    transform: none;
  }

  body.profile-page .profile-avatar-upload-hero { width: 82px; height: 82px; }
  body.profile-page .profile-avatar-hero { border-width: 3px; }
  body.profile-page .profile-presence { left: 41px; bottom: -5px; min-width: 60px; font-size: 7px; }

  body.profile-page .profile-header-copy,
  body.profile-page .profile-identity-inline { display: block !important; }

  body.profile-page .profile-main-meta {
    grid-column: auto;
    grid-row: auto;
    align-self: center;
    padding: 0 !important;
  }

  body.profile-page .profile-name-row h1 { font-size: clamp(23px, 7vw, 29px); }
  body.profile-page .profile-edit-chip { width: 30px; height: 30px; flex-basis: 30px; }

  body.profile-page .profile-submeta-row {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 5px 8px;
  }

  body.profile-page .profile-role-tags {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
    flex-wrap: wrap !important;
    row-gap: 4px;
  }

  body.profile-page .profile-view-switch-wrap {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: flex-start;
  }

  body.profile-page .profile-view-toggle {
    width: auto;
    min-width: 122px;
    min-height: 52px;
  }

  body.profile-page .profile-bio-block {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    padding: 15px;
    border-radius: 17px;
  }

  body.profile-page .profile-summary-bio { font-size: 11px; }

  body.profile-page .profile-stats-standalone {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px;
    overflow: visible;
  }

  body.profile-page .profile-level-card {
    min-height: 68px;
    margin: 0;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }

  body.profile-page .profile-level-orbit { width: 48px; height: 48px; flex-basis: 48px; }
  body.profile-page #profile-room-level { font-size: 17px; }

  body.profile-page .profile-stat-box {
    min-height: 62px;
    padding: 8px 5px;
    border-right: 1px solid rgba(255, 255, 255, 0.09);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 15px;
  }

  body.profile-page .profile-stat-copy { justify-items: center; text-align: center; }
  body.profile-page .profile-stat-box strong { font-size: 17px; }
  body.profile-page .profile-stat-label { font-size: 7px; }

  body.profile-page.is-profile-preview .profile-summary-banner {
    padding-top: 86px;
    transform: translateY(-30px);
  }
  body.profile-page.is-profile-preview .profile-header {
    width: calc(100% - 24px);
    margin: 0 12px !important;
    padding: 0;
  }
  body.profile-page.is-profile-preview .profile-identity-bar {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
  }
  body.profile-page.is-profile-preview .profile-header-avatar {
    position: relative;
    left: auto;
    top: auto;
    width: 86px;
    transform: none;
  }
  body.profile-page.is-profile-preview .profile-avatar-upload-hero {
    width: 82px;
    height: 82px;
  }
  body.profile-page.is-profile-preview .profile-presence { left: 41px; }
}

@media (max-width: 410px) {
  body.profile-page .profile-summary-banner { min-height: 0; }
  body.profile-page .profile-identity-bar { grid-template-columns: 78px minmax(0, 1fr); }
  body.profile-page .profile-header-avatar { width: 78px; }
  body.profile-page .profile-avatar-upload-hero { width: 74px; height: 74px; }
  body.profile-page .profile-presence { left: 37px; }
}

/* Profile loading skeleton */
body.profile-page .profile-shell {
  position: relative;
}

body.profile-page .profile-loading-skeleton {
  position: absolute;
  z-index: 40;
  top: 22px;
  right: 0;
  left: 0;
  display: block;
  color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.24s ease, filter 0.3s ease, transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.36s;
}

body.profile-page.is-profile-entering .profile-loading-skeleton {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

body.profile-page.is-profile-skeleton-leaving .profile-loading-skeleton {
  opacity: 0;
  filter: blur(4px);
  visibility: hidden;
  transform: translateY(-9px) scale(0.995);
  transition-delay: 0s, 0s, 0s, 0.23s;
}

body.profile-page .profile-skeleton-surface {
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: linear-gradient(145deg, rgba(18, 18, 24, 0.96), rgba(9, 10, 14, 0.94));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 18px 42px rgba(0, 0, 0, 0.18);
}

body.profile-page .profile-skeleton-shape {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045) 20%, rgba(255, 255, 255, 0.105) 38%, rgba(var(--room-accent-rgb), 0.075) 48%, rgba(255, 255, 255, 0.045) 66%);
  background-size: 240% 100%;
  animation: kaiyoProfileSkeletonShimmer 1.45s linear infinite;
}

body.profile-page .profile-skeleton-hero {
  padding: 0 20px;
}

body.profile-page .profile-skeleton-banner {
  position: relative;
  width: calc(100% - 64px);
  height: clamp(300px, 29vw, 380px);
  min-height: 300px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 25px;
  background:
    radial-gradient(circle at 76% 26%, rgba(var(--room-accent-rgb), 0.065), transparent 30%),
    linear-gradient(135deg, rgba(25, 25, 32, 0.98), rgba(10, 11, 15, 0.97));
}

body.profile-page .profile-skeleton-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, 0.035) 40%, rgba(var(--room-accent-rgb), 0.05) 50%, transparent 72%);
  transform: translateX(-105%);
  animation: kaiyoProfileSkeletonSweep 2.2s linear infinite;
}

body.profile-page .profile-skeleton-header-stack {
  position: relative;
  z-index: 1;
  width: calc(100% - 64px);
  margin: -14px auto 0;
  display: grid;
  gap: 12px;
}

body.profile-page .profile-skeleton-identity {
  position: relative;
  min-height: 96px;
  padding: 13px 17px 13px 132px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-radius: 24px;
}

body.profile-page .profile-skeleton-avatar {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 50%;
  width: 100px;
  height: 100px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  transform: translateY(-62%);
}

body.profile-page .profile-skeleton-identity-copy {
  min-width: 0;
  display: grid;
  gap: 11px;
}

body.profile-page .profile-skeleton-line {
  height: 9px;
  border-radius: 999px;
}

body.profile-page .profile-skeleton-line-name { width: min(43%, 300px); height: 27px; }
body.profile-page .profile-skeleton-meta-lines { display: flex; align-items: center; gap: 12px; }
body.profile-page .profile-skeleton-line-meta { width: 74px; }
body.profile-page .profile-skeleton-line-meta-short { width: 112px; }
body.profile-page .profile-skeleton-line-role { width: 86px; }

body.profile-page .profile-skeleton-preview-button {
  width: 126px;
  height: 44px;
  border-radius: 13px;
}

body.profile-page .profile-skeleton-bio {
  width: min(78%, 880px);
  min-height: 72px;
  padding: 17px 19px;
  display: grid;
  align-content: center;
  gap: 11px;
  border-radius: 19px;
}

body.profile-page .profile-skeleton-line-kicker { width: 58px; height: 6px; }
body.profile-page .profile-skeleton-line-bio { width: min(68%, 470px); }

body.profile-page .profile-skeleton-stats {
  display: grid;
  grid-template-columns: minmax(255px, 1.35fr) repeat(3, minmax(120px, 0.65fr));
  gap: 9px;
}

body.profile-page .profile-skeleton-level,
body.profile-page .profile-skeleton-stat {
  min-width: 0;
  min-height: 86px;
  border-radius: 18px;
}

body.profile-page .profile-skeleton-level {
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

body.profile-page .profile-skeleton-level-circle {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
}

body.profile-page .profile-skeleton-level > span {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 7px;
}

body.profile-page .profile-skeleton-line-rank { width: 92px; height: 11px; }
body.profile-page .profile-skeleton-line-progress { width: min(100%, 170px); height: 4px; }
body.profile-page .profile-skeleton-line-note { width: 122px; height: 7px; }

body.profile-page .profile-skeleton-stat {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
}

body.profile-page .profile-skeleton-stat-value { width: 42px; height: 17px; border-radius: 999px; }
body.profile-page .profile-skeleton-stat-label { width: 54px; height: 7px; border-radius: 999px; }

body.profile-page .profile-skeleton-tabs {
  width: max-content;
  margin: 14px 0 0 52px;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(4, 126px);
  gap: 3px;
  border-radius: 15px;
}

body.profile-page .profile-skeleton-tab {
  height: 43px;
  border-radius: 11px;
}

body.profile-page .profile-skeleton-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  gap: 18px;
}

body.profile-page .profile-skeleton-panel {
  min-width: 0;
  min-height: 378px;
  margin-top: 18px;
  padding: 24px;
  border-radius: 22px;
}

body.profile-page .profile-skeleton-panel-title {
  width: 160px;
  height: 24px;
  margin-bottom: 20px;
  border-radius: 9px;
}

body.profile-page .profile-skeleton-poster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.profile-page .profile-skeleton-poster-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.profile-page .profile-skeleton-poster {
  width: 100%;
  max-height: 246px;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
}

@keyframes kaiyoProfileSkeletonShimmer {
  from { background-position: 180% 0; }
  to { background-position: -180% 0; }
}

@keyframes kaiyoProfileSkeletonSweep {
  from { transform: translateX(-105%); }
  to { transform: translateX(105%); }
}

@media (max-width: 900px) {
  body.profile-page .profile-loading-skeleton { top: 14px; }
  body.profile-page .profile-skeleton-hero { padding: 0 12px; }
  body.profile-page .profile-skeleton-banner {
    width: calc(100% - 24px);
    height: clamp(250px, 40vw, 330px);
    min-height: 250px;
    border-radius: 22px;
  }
  body.profile-page .profile-skeleton-header-stack {
    width: calc(100% - 48px);
    margin-top: -12px;
  }
  body.profile-page .profile-skeleton-identity {
    min-height: 132px;
    padding-left: 120px;
  }
  body.profile-page .profile-skeleton-avatar { width: 94px; height: 94px; }
  body.profile-page .profile-skeleton-bio { width: 100%; }
  body.profile-page .profile-skeleton-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.profile-page .profile-skeleton-level { grid-column: 1 / -1; }
  body.profile-page .profile-skeleton-panels { grid-template-columns: minmax(0, 1fr); }
  body.profile-page .profile-skeleton-panel { min-height: 310px; }
  body.profile-page .profile-skeleton-poster-grid,
  body.profile-page .profile-skeleton-poster-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body.profile-page .profile-loading-skeleton { top: 10px; }
  body.profile-page .profile-skeleton-hero { padding: 0 10px; }
  body.profile-page .profile-skeleton-banner {
    width: 100%;
    height: clamp(205px, 57vw, 260px);
    min-height: 205px;
    border-radius: 18px;
  }
  body.profile-page .profile-skeleton-header-stack {
    width: 100%;
    margin-top: -10px;
    gap: 10px;
  }
  body.profile-page .profile-skeleton-identity {
    min-height: 174px;
    padding: 80px 13px 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    border-radius: 19px;
  }
  body.profile-page .profile-skeleton-avatar {
    left: 13px;
    top: 8px;
    width: 74px;
    height: 74px;
    transform: none;
  }
  body.profile-page .profile-skeleton-line-name { width: min(72%, 230px); height: 22px; }
  body.profile-page .profile-skeleton-meta-lines { flex-wrap: wrap; gap: 8px; }
  body.profile-page .profile-skeleton-preview-button { width: 112px; height: 42px; }
  body.profile-page .profile-skeleton-bio { min-height: 65px; padding: 15px; border-radius: 17px; }
  body.profile-page .profile-skeleton-stats { gap: 7px; }
  body.profile-page .profile-skeleton-level { min-height: 68px; padding: 8px 12px; }
  body.profile-page .profile-skeleton-level-circle { width: 48px; height: 48px; flex-basis: 48px; }
  body.profile-page .profile-skeleton-stat { min-height: 62px; }
  body.profile-page .profile-skeleton-tabs {
    width: calc(100% - 20px);
    margin: 12px 10px 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    padding: 4px;
  }
  body.profile-page .profile-skeleton-tab { height: 41px; }
  body.profile-page .profile-skeleton-panels { gap: 12px; padding: 0 10px; }
  body.profile-page .profile-skeleton-panel {
    min-height: 280px;
    margin-top: 12px;
    padding: 18px 15px;
    border-radius: 18px;
  }
  body.profile-page .profile-skeleton-panel + .profile-skeleton-panel { margin-top: 0; }
  body.profile-page .profile-skeleton-poster-grid,
  body.profile-page .profile-skeleton-poster-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.profile-page .profile-skeleton-poster:nth-child(n + 3) { display: none; }
}

/* First-load profile reveal */
body.profile-page.is-profile-entering .profile-page-backdrop {
  opacity: 0 !important;
}

body.profile-page.is-profile-entering .profile-banner-shell,
body.profile-page.is-profile-entering .profile-identity-bar,
body.profile-page.is-profile-entering .profile-bio-block,
body.profile-page.is-profile-entering .profile-stats-standalone,
body.profile-page.is-profile-entering .profile-overview .profile-section-tabs,
body.profile-page.is-profile-entering .profile-tab-panel.is-active {
  opacity: 0 !important;
  animation: none !important;
}

body.profile-page.is-profile-ready .profile-page-backdrop {
  animation: kaiyoProfileBackdropIn 1.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.profile-page.is-profile-ready:not(.is-profile-preview) .profile-banner-shell {
  animation: kaiyoProfileBannerIn 0.78s 0.06s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.profile-page.is-profile-ready .profile-identity-bar {
  animation: kaiyoProfileCardIn 0.72s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.profile-page.is-profile-ready .profile-bio-block {
  animation: kaiyoProfileCardIn 0.66s 0.31s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.profile-page.is-profile-ready:not(.is-profile-preview) .profile-stats-standalone {
  animation: kaiyoProfileCardIn 0.64s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.profile-page.is-profile-ready:not(.is-profile-preview) .profile-overview .profile-section-tabs {
  animation: kaiyoProfileNavIn 0.58s 0.49s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.profile-page.is-profile-ready:not(.is-profile-preview) .profile-tab-panel.is-active {
  animation: kaiyoProfilePanelIn 0.68s 0.57s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes kaiyoProfileBackdropIn {
  from {
    opacity: 0;
    filter: blur(14px) saturate(0.72);
    transform: scale(1.065);
  }
}

@keyframes kaiyoProfileBannerIn {
  from {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(24px) scale(0.985);
  }
}

@keyframes kaiyoProfileCardIn {
  from {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(20px) scale(0.985);
  }
}

@keyframes kaiyoProfileNavIn {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(14px) scale(0.99);
  }
}

@keyframes kaiyoProfilePanelIn {
  from {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(22px);
  }
}

@media (max-width: 640px) {
  @keyframes kaiyoProfileBannerIn {
    from { opacity: 0; filter: blur(5px); transform: translateY(16px) scale(0.99); }
  }

  @keyframes kaiyoProfileCardIn {
    from { opacity: 0; filter: blur(4px); transform: translateY(14px) scale(0.99); }
  }
}

@media (prefers-reduced-motion: reduce) {
  body.profile-page .profile-loading-skeleton,
  body.profile-page .profile-skeleton-shape,
  body.profile-page .profile-skeleton-banner::after {
    animation: none !important;
    transition: none !important;
  }

  body.profile-page .profile-view-toggle:hover::after,
  body.profile-page .profile-view-toggle:focus-visible::after,
  body.profile-page.is-profile-ready .profile-page-backdrop,
  body.profile-page.is-profile-ready .profile-banner-shell,
  body.profile-page.is-profile-ready .profile-identity-bar,
  body.profile-page.is-profile-ready .profile-bio-block,
  body.profile-page.is-profile-ready .profile-stats-standalone,
  body.profile-page.is-profile-ready .profile-overview .profile-section-tabs,
  body.profile-page.is-profile-ready .profile-tab-panel.is-active {
    animation: none !important;
  }
}
