:root {
  --gp-blue: #071a33;
  --gp-blue-2: #0d2a50;
  --gp-gold: #d7a84f;
  --gp-text: #172033;
  --gp-muted: #667085;
  --gp-border: #e5e7eb;
  --gp-bg: #f5f7fb;
  --gp-card: #ffffff;
  --gp-danger: #b42318;
  --gp-success: #067647;
}

body {
  margin: 0;
  background: var(--gp-bg);
  color: var(--gp-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.profileTopbar {
  min-height: 72px;
  padding: 0 28px;
  background: linear-gradient(135deg, var(--gp-blue), var(--gp-blue-2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--gp-gold);
}

.profileBrand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.profileBrand img {
  height: 46px;
  width: auto;
  display: block;
}

.profileNav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profileNav a,
.profileNav button {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.profileNav a:hover,
.profileNav button:hover {
  color: var(--gp-gold);
}

.profilePage {
  max-width: 1180px;
  margin: 0 auto;
  padding: 90px 20px 56px;
}

.profileHero {
  background:
    radial-gradient(circle at top right, rgba(215, 168, 79, 0.18), transparent 34%),
    linear-gradient(135deg, #081b34, #113763);
  color: #ffffff;
  border-radius: 24px;
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 18px 40px rgba(7, 26, 51, 0.18);
}

.profileHero h1 {
  margin: 4px 0 10px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.04em;
}

.profileHero p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gp-gold);
}

.heroAction {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--gp-gold);
  color: #071a33;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.profileStatus {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--gp-border);
  font-weight: 650;
}

.profileStatus.success {
  color: var(--gp-success);
  border-color: rgba(6, 118, 71, 0.24);
  background: #ecfdf3;
}

.profileStatus.error {
  color: var(--gp-danger);
  border-color: rgba(180, 35, 24, 0.24);
  background: #fef3f2;
}

.profileGrid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.profileCard {
  background: var(--gp-card);
  border: 1px solid var(--gp-border);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.profileMainCard {
  padding: 26px;
}

.profileSideCard {
  padding: 22px;
  position: sticky;
  top: 18px;
}

.profileHeaderBlock {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--gp-border);
}

.avatarWrap {
  width: 108px;
  height: 108px;
  border-radius: 999px;
  border: 3px solid var(--gp-gold);
  padding: 4px;
  background: #fff;
  flex: 0 0 auto;
}

.profileAvatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
  background: #eef2f7;
}

.profileHeaderBlock h2,
.sideHeader h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.muted {
  color: var(--gp-muted);
}

.profileForm {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.formRow.twoColumns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profileForm label {
  display: grid;
  gap: 8px;
  font-weight: 750;
  color: #263247;
}

.profileForm input,
.profileForm textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--gp-border);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: var(--gp-text);
  background: #ffffff;
  outline: none;
}

.profileForm input:focus,
.profileForm textarea:focus {
  border-color: var(--gp-gold);
  box-shadow: 0 0 0 4px rgba(215, 168, 79, 0.17);
}

.uploadBox {
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  background: #f8fafc;
}

.uploadBox p {
  margin: 5px 0 0;
  color: var(--gp-muted);
  font-size: 0.92rem;
}

.profileActions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profileActions button {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 22px;
  background: var(--gp-blue);
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
}

.profileActions button:hover {
  background: var(--gp-blue-2);
}

.profileActions button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.secondaryLink {
  color: var(--gp-blue-2);
  font-weight: 750;
  text-decoration: none;
}

.secondaryLink:hover {
  text-decoration: underline;
}

.sideHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gp-border);
}

.countPill {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(215, 168, 79, 0.18);
  color: #7a5412;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.articlesList {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.articleItem {
  border: 1px solid var(--gp-border);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

.articleItem a {
  color: var(--gp-blue);
  text-decoration: none;
  font-weight: 850;
  line-height: 1.3;
}

.articleItem a:hover {
  text-decoration: underline;
}

.articleMeta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--gp-muted);
  font-size: 0.86rem;
}

.statusBadge {
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 750;
}

.authorTools {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--gp-border);
}

.authorTools h3 {
  margin: 0 0 12px;
}

.toolLink {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--gp-border);
  text-decoration: none;
  color: var(--gp-text);
  background: #f8fafc;
  margin-top: 10px;
}

.toolLink span {
  font-weight: 850;
  color: var(--gp-blue);
}

.toolLink small {
  color: var(--gp-muted);
  line-height: 1.4;
}

.toolLink:hover {
  border-color: var(--gp-gold);
  background: #fffaf0;
}

@media (max-width: 860px) {
  .profileTopbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
  }

  .profileNav {
    flex-wrap: wrap;
  }

  .profileHero {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px;
  }

  .profileGrid {
    grid-template-columns: 1fr;
  }

  .profileSideCard {
    position: static;
  }

  .formRow.twoColumns,
  .uploadBox {
    grid-template-columns: 1fr;
  }
}
.profileHeaderBlock {
  align-items: center;
  gap: 28px;
}

.profileIdentityBlock {
  min-width: 0;
}

.contributorLevelWrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.contributorLevelBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 154, 59, 0.55);
  background: rgba(201, 154, 59, 0.12);
  color: #8a5f12;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.contributorCountText {
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .profileHeaderBlock {
    align-items: flex-start;
  }

  .contributorLevelWrap {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
/* ============================
   Contributor level + badges
   ============================ */

.profileHeaderBlock {
  display: flex;
  align-items: center;
  gap: 28px;
}

.profileIdentityBlock {
  min-width: 0;
  flex: 1;
}

.contributorLevelWrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.contributorLevelBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(201, 154, 59, 0.55);
  background: linear-gradient(
    135deg,
    rgba(201, 154, 59, 0.18),
    rgba(201, 154, 59, 0.07)
  );
  color: #8a5f12;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.contributorCountText {
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 650;
}

.authorBadges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.authorBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.authorBadgeIcon {
  font-size: 0.95rem;
  line-height: 1;
}

.authorBadge.gold {
  border-color: rgba(201, 154, 59, 0.42);
  background: rgba(201, 154, 59, 0.1);
  color: #8a5f12;
}

.authorBadge.blue {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.authorBadge.green {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
}

.authorBadge.purple {
  border-color: rgba(124, 58, 237, 0.22);
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
}

/* ============================
   Mobile profile header
   ============================ */

@media (max-width: 760px) {
  .profileHeaderBlock {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
  }

  .profileIdentityBlock {
    width: 100%;
  }

  .profileIdentityBlock .eyebrow {
    text-align: center;
  }

  .profileIdentityBlock h2 {
    margin-top: 4px;
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .profileIdentityBlock .muted {
    overflow-wrap: anywhere;
  }

  .contributorLevelWrap {
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
  }

  .contributorLevelBadge {
    min-height: 34px;
    padding: 8px 16px;
    font-size: 0.76rem;
  }

  .contributorCountText {
    width: 100%;
    font-size: 0.9rem;
  }

  .authorBadges {
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
  }

  .authorBadge {
    font-size: 0.74rem;
    padding: 7px 10px;
  }
}

@media (max-width: 420px) {
  .profileCard {
    border-radius: 22px;
  }

  .profileAvatar {
    width: 104px;
    height: 104px;
  }

  .avatarWrap {
    width: 116px;
    height: 116px;
  }

  .profileIdentityBlock h2 {
    font-size: 1.4rem;
  }

  .contributorLevelWrap {
    flex-direction: column;
  }

  .contributorLevelBadge,
  .contributorCountText {
    width: fit-content;
    max-width: 100%;
  }

  .authorBadges {
    flex-direction: column;
  }

  .authorBadge {
    max-width: 100%;
  }
}
.contributorLevelBadge.gold {
  border-color: rgba(201, 154, 59, 0.55);
  background: linear-gradient(
    135deg,
    rgba(201, 154, 59, 0.2),
    rgba(201, 154, 59, 0.08)
  );
  color: #8a5f12;
}

.contributorLevelBadge.green {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.09);
  color: #15803d;
}

.contributorLevelBadge.blue {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.09);
  color: #1d4ed8;
}

.contributorLevelBadge.purple {
  border-color: rgba(124, 58, 237, 0.28);
  background: rgba(124, 58, 237, 0.09);
  color: #6d28d9;
}

/* ============================
   Admin profile page overrides
   ============================ */
    body.authGuarding .adminPageContent { display: none; }
    .adminProfileAccessMessage { margin: 8rem auto 2rem; max-width: 760px; padding: 1.25rem 1.5rem; border-radius: 18px; background: #fff; box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14); color: #0f172a; }

    /*
      Admin header spacing for /pages/profile.html.

      The admin header is fixed, so the page content must be pushed down by
      approximately the header height plus the desired visible gap.

      Adjust --profile-admin-header-offset if your header height changes.
      Adjust --profile-admin-header-gap for the space between header and boxes.
    */
    :root {
      --profile-admin-header-offset: 24px;
      --profile-admin-header-gap: 20px;
    }

    .adminPageContent {
      padding-top: var(--profile-admin-header-offset) !important;
    }

    .profilePage {
      padding-top: var(--profile-admin-header-gap) !important;
    }

    .profileNameActionRow {
      display: flex;
      align-items: center;
      gap: 1rem;
      flex-wrap: wrap;
    }

    .profileNameActionRow h2 {
      margin: 0;
    }

    .profileInlineArticleCta {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      background: #daa648;
      color: #07162c;
      font-size: 0.95rem;
      font-weight: 900;
      line-height: 1;
      padding: 0.72rem 1.05rem;
      text-decoration: none;
      box-shadow: 0 10px 20px rgba(15, 42, 95, 0.12);
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .profileInlineArticleCta:hover,
    .profileInlineArticleCta:focus-visible {
      transform: translateY(-1px);
      box-shadow: 0 14px 26px rgba(15, 42, 95, 0.18);
      outline: none;
    }
    .articleActions {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
      margin-top: 0.75rem;
    }

    .articleActionBtn {
      border: 1px solid rgba(15, 23, 42, 0.16);
      border-radius: 999px;
      padding: 0.42rem 0.85rem;
      font: inherit;
      font-size: 0.85rem;
      font-weight: 700;
      cursor: pointer;
      background: #ffffff;
      color: #0f172a;
      transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    }

    .articleActionBtn:hover,
    .articleActionBtn:focus-visible {
      border-color: rgba(15, 23, 42, 0.35);
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
      transform: translateY(-1px);
      outline: none;
    }

    .editArticleBtn {
      background: #0f2a5f;
      border-color: #0f2a5f;
      color: #ffffff;
    }

    .deleteArticleBtn {
      color: #9f1239;
      border-color: rgba(159, 18, 57, 0.28);
    }

    .articleActionBtn:disabled {
      cursor: wait;
      opacity: 0.65;
      transform: none;
      box-shadow: none;
    }


    .heroActionsStack {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 0.85rem;
    }

    .draftReminder {
      width: min(360px, 100%);
      box-sizing: border-box;
      border: 1px solid rgba(218, 166, 72, 0.42);
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.94);
      color: #0f172a;
      box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
      padding: 0.9rem 1rem;
    }

    .draftReminder[hidden] {
      display: none;
    }

    .draftReminderText {
      display: block;
      font-size: 0.92rem;
      font-weight: 800;
      line-height: 1.35;
      margin-bottom: 0.7rem;
    }

    .draftReminderLink {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      background: #0f2a5f;
      color: #ffffff;
      font-size: 0.86rem;
      font-weight: 800;
      line-height: 1;
      padding: 0.62rem 0.95rem;
      text-decoration: none;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .draftReminderLink:hover,
    .draftReminderLink:focus-visible {
      box-shadow: 0 10px 20px rgba(15, 42, 95, 0.22);
      transform: translateY(-1px);
      outline: none;
    }

    @media (max-width: 780px) {
      .heroActionsStack {
        align-items: stretch;
        width: 100%;
      }

      .heroActionsStack .heroAction,
      .draftReminder {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
      }
    }



.toolLink.primaryTool {
  background: linear-gradient(135deg, var(--gp-blue), var(--gp-blue-2));
  color: #fff;
  border-color: rgba(215, 168, 79, 0.35);
}

.toolLink.primaryTool span,
.toolLink.primaryTool small {
  color: #fff;
}

.profileQuickLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.profileQuickLinks a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--gp-blue-2);
  background: #fff;
  text-decoration: none;
  font-weight: 850;
  font-size: 0.86rem;
}

.memberQuickHint,
.memberActivityIntro {
  color: var(--gp-muted);
  line-height: 1.55;
}

.memberActivityIntro {
  margin: 1.25rem 0 0;
}
