/* Homepage AP header — restore working hybrid:
   old header LAYOUT (banner strip + overlapping avatar) + AP CONTENT */

.wrapper:has(.ap-home-profile),
.page-content:has(.ap-home-profile),
#main:has(.ap-home-profile) {
  overflow: visible !important;
}

.ap-home-profile {
  margin: 0 0 1.5rem;
  width: 100%;
  max-width: 100%;
  overflow: visible !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
}

.ap-home-profile__card {
  position: relative;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}

/* Same role as old .profile-header */
.ap-home-profile__banner {
  display: block;
  width: 100%;
  height: 165px;
  max-height: 165px;
  background: #1a1a1a center / cover no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 0;
  overflow: hidden;
}

/* Same role as old .profile-info */
.ap-home-profile__body {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 2rem 2rem;
  overflow: visible !important;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  background: var(--content-bg, rgba(24, 24, 24, 0.8));
  box-shadow: 0 2px 22px rgba(0, 0, 0, 0.3);
}

.ap-home-profile__identity {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 1rem;
  margin: 0;
  padding: 0;
  overflow: visible !important;
}

/* Old .avatar-section { margin: -68px 0 0 } */
.ap-home-profile__avatar-wrap {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin: -68px 0 0;
  padding: 0;
  overflow: visible !important;
  line-height: 0;
}

.ap-home-profile__avatar,
.ap-home-profile img.ap-home-profile__avatar,
.ap-home-profile__avatar-wrap img {
  position: static !important;
  display: block !important;
  width: 136px !important;
  height: 136px !important;
  max-width: 136px !important;
  max-height: 136px !important;
  min-width: 136px !important;
  min-height: 136px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 5px solid rgba(83, 216, 240, 0.34) !important;
  background: #222 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ap-home-profile__titles {
  flex: 1;
  min-width: 0;
  padding: 0 0 0.35rem;
}

.ap-home-profile__name {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--body-txt, #e8e8e8);
  word-break: break-word;
}

.ap-home-profile__name a {
  color: inherit;
  text-decoration: none;
}

.ap-home-profile__name a:hover {
  color: var(--feed-text, #53d8f0);
}

.ap-home-profile__handle {
  margin: 0.35rem 0 0;
  font-size: 1.1rem;
  color: var(--muted-text, #8a8a8a);
}

.ap-home-profile__handle a {
  color: var(--feed-text, #53d8f0);
  text-decoration: none;
  font-weight: 600;
}

.ap-home-profile__handle a:hover {
  text-decoration: underline;
}

.ap-home-profile__summary {
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--body-txt, #e8e8e8);
  text-align: left;
  max-width: 70%;
}

.ap-home-profile__summary p {
  margin: 0 0 0.55rem;
}

.ap-home-profile__summary a,
.ap-home-profile__fields a {
  color: var(--feed-text, #7ee0ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Profile PropertyValue fields stay on /users/cmdr_nova — homepage has social icons below */
.ap-home-profile__fields {
  display: none !important;
}

.ap-home-profile__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ap-home-profile__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 90px;
  color: inherit;
  text-decoration: none;
  border: 0 !important;
  background: none !important;
}

.ap-home-profile__stat:hover .ap-home-profile__stat-n {
  color: var(--feed-text, #53d8f0) !important;
}

.ap-home-profile__stat-n {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--waifu-txt, #00fc69) !important;
  line-height: 1;
}

.ap-home-profile__stat-l {
  font-size: 0.9rem;
  color: var(--muted-text, #666);
  margin-top: 0.25rem;
  text-transform: lowercase;
}

/* Follow panel under control deck */
.ap-follow-panel {
  width: 100%;
  max-width: 28rem;
  margin: 0.85rem auto 0;
  padding: 0.85rem 1rem;
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}
.ap-follow-panel[hidden] { display: none !important; }
.ap-follow-label {
  display: block; margin: 0 0 0.55rem; font-size: 0.9rem;
  color: var(--body-txt, #e8e8e8); text-align: center;
}
.ap-follow-row { display: flex; gap: 0.5rem; align-items: stretch; }
.ap-follow-row input {
  flex: 1; min-width: 0; padding: 0.55rem 0.7rem; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: #0c0c0c;
  color: var(--body-txt, #e8e8e8); font: inherit;
}
.ap-follow-hint {
  margin: 0.55rem 0 0; font-size: 0.75rem; color: var(--muted-text, #8a8a8a);
  text-align: center; line-height: 1.4;
}
.ap-follow-hint.is-error { color: #ff8e8e; }

/* Homepage Latest Status — media / poll / quote */
.ap-site-latest__cw {
  margin: 0.35rem 0 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 200, 80, 0.35);
  background: rgba(40, 32, 8, 0.55);
  color: #f0d78a;
  font-size: 0.88rem;
}
.ap-site-latest__media {
  margin: 0.75rem 0 0.35rem;
  width: 100%;
}
.ap-site-latest__media .gts-image-wrapper img,
.ap-site-latest__img {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.ap-site-latest__video video,
.ap-site-latest__audio audio {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  background: #0a0a0a;
}
.ap-site-latest__file {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}
.ap-site-latest__poll {
  margin: 0.75rem 0 0.25rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 18, 24, 0.85);
}
.ap-site-latest__poll-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a9aaa;
  margin-bottom: 0.4rem;
}
.ap-site-latest__poll-opt {
  display: block;
  margin: 0.28rem 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 24, 32, 0.9);
  color: #dce6f0;
  font-size: 0.88rem;
}
.ap-site-latest__quote {
  margin: 0.65rem 0 0.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 18, 24, 0.85);
  color: #c8d2dc;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.ap-site-latest__quote-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a9aaa;
  margin-bottom: 0.3rem;
}
.ap-site-latest__quote-text {
  white-space: pre-wrap;
}
.ap-site-latest__quote-link {
  margin-top: 0.4rem;
  font-size: 0.78rem;
}
.ap-site-latest__quote a {
  color: #9ad4e8;
}

@media (max-width: 700px) {
  .ap-home-profile__banner { height: 140px; max-height: 140px; }
  .ap-home-profile__body { padding: 0 1rem 1.5rem; }
  .ap-home-profile__avatar-wrap { margin-top: -60px; }
  .ap-home-profile__avatar,
  .ap-home-profile img.ap-home-profile__avatar,
  .ap-home-profile__avatar-wrap img {
    width: 110px !important; height: 110px !important;
    max-width: 110px !important; max-height: 110px !important;
    min-width: 110px !important; min-height: 110px !important;
  }
  .ap-home-profile__name { font-size: 1.5rem; }
  .ap-home-profile__summary { max-width: 100%; }
  .ap-follow-row { flex-direction: column; }
}
