/* ==========================================================================
   RepHub — navigation (desktop pill bar + mobile bottom icon bar)
   Loaded after rephub.css / rephub-v7.css so it wins.
   ========================================================================== */

:root {
  --nav-h: 68px;
  --mobile-nav-h: 64px;
}

/* ---------- Desktop: floating dark pill bar ---------- */
@media (min-width: 861px) {
  body { padding-top: 22px; }

  header.nav {
    position: sticky;
    top: 14px;
    z-index: 60;
    width: min(1560px, calc(100% - 32px));
    margin: 0 auto 8px;
    padding: 12px 22px;
    display: grid;
    /* Equal side columns keep the links perfectly centered in the bar. */
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
    align-items: center;
    gap: 24px;
    border: 1px solid #1b241c;
    border-radius: 18px;
    background:
      radial-gradient(120% 220% at 8% 120%, #9ef01a14 0%, transparent 55%),
      radial-gradient(120% 220% at 92% 120%, #9ef01a10 0%, transparent 55%),
      linear-gradient(180deg, #121612 0%, #0b0e0b 100%);
    box-shadow:
      0 1px 0 #ffffff0a inset,
      0 24px 60px -34px #000,
      0 0 40px -22px #9ef01a55;
    backdrop-filter: blur(10px);
  }

  header.nav .brand { gap: 12px; }
  /* Plain logo mark — no box, no border, no plate behind it. */
  header.nav .brand-mark {
    width: 38px; height: 38px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    filter: drop-shadow(0 0 12px #9ef01a55);
  }
  header.nav .brand-text { font-size: 20px; letter-spacing: 1px; }

  header.nav .brand { justify-self: start; }
  header.nav .nav-right { justify-self: end; }
  header.nav .nav-links { gap: 34px; justify-content: center; justify-self: center; }
  header.nav .nav-links a {
    font-size: 15px; font-weight: 500; padding: 8px 2px;
    transition: color .15s ease;
  }
  header.nav .nav-links a.active { color: #fff; font-weight: 600; }
  header.nav .nav-links a.active::after {
    content: "";
    position: absolute; left: 2px; right: 2px; bottom: -12px;
    height: 3px; border-radius: 3px;
    background: var(--accent);
    box-shadow: 0 0 14px 1px #9ef01aaa;
  }

  /* user pill with glowing avatar ring */
  header.nav .chip-user {
    gap: 12px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #141914 0%, #0c100c 100%);
    border: 1px solid #223022;
    box-shadow: 0 0 30px -16px #9ef01a99, 0 1px 0 #ffffff08 inset;
    cursor: pointer;
  }
  header.nav .chip-user:hover { border-color: #35492f; }
  header.nav .chip-user img,
  header.nav .chip-user .chip-dot {
    width: 34px; height: 34px; border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 16px -2px #9ef01aaa;
    background: #0c100c;
  }
  header.nav .chip-user .uname { font-size: 15px; font-weight: 600; }
}

/* ---------- Mobile: compact top bar + floating bottom icon pill ---------- */
.mobile-nav { display: none; }

@media (max-width: 860px) {
  header.nav {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #0a0d0acc;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: transform .28s cubic-bezier(.22,.8,.3,1);
  }
  header.nav .nav-links { display: none !important; }
  header.nav .lang-switch,
  header.nav .icon-btn { display: none; }
  header.nav .chip-user { padding: 4px 10px 4px 4px; }
  header.nav .chip-user img { width: 28px; height: 28px; border: 2px solid var(--accent); }
  header.nav .chip-user .uname { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  body { padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 28px); }
  .foot { margin-bottom: 0; }

  /* floating detached pill */
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    height: var(--mobile-nav-h);
    border: 1px solid #1b241c;
    border-radius: 26px;
    background:
      radial-gradient(120% 200% at 50% 130%, #9ef01a12 0%, transparent 60%),
      linear-gradient(180deg, #121612 0%, #0a0d0a 100%);
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 44px -22px #000, 0 0 40px -26px #9ef01a66, 0 1px 0 #ffffff0a inset;
    transition: transform .28s cubic-bezier(.22,.8,.3,1), opacity .2s ease;
  }
  .mobile-nav a, .mobile-nav button {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px;
    background: none; border: 0; cursor: pointer;
    color: var(--muted); font-size: 11px; font-weight: 500;
    font-family: inherit;
    padding: 0; -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav svg { width: 22px; height: 22px; }
  .mobile-nav .mn-label { line-height: 1; }
  .mobile-nav .active { color: var(--accent); font-weight: 700; }
  .mobile-nav .active svg { filter: drop-shadow(0 0 8px #9ef01a88); }

  /* scroll away / come back */
  body.nav-hidden .mobile-nav {
    transform: translateY(calc(100% + 28px));
    opacity: 0;
  }
  body.nav-hidden header.nav { transform: translateY(-110%); }
}

/* ---------- Mobile "more" sheet ---------- */
.mn-sheet-backdrop {
  position: fixed; inset: 0; z-index: 95;
  background: #000000b8;
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.mn-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.mn-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 96;
  max-height: 88vh; overflow-y: auto;
  transform: translateY(110%);
  transition: transform .22s cubic-bezier(.22,.8,.3,1);
  background: linear-gradient(180deg, #12171280 0%, #0b0e0b 100%), #0b0e0b;
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 26px);
  box-shadow: 0 -30px 60px -30px #000;
}
.mn-sheet.open { transform: translateY(0); }
.mn-sheet .mn-grip {
  width: 44px; height: 4px; border-radius: 99px; background: #2a352b;
  margin: 4px auto 14px;
}
.mn-sheet .mn-sheet-title {
  font-size: 12px; letter-spacing: 3px; font-weight: 700;
  color: #6d7a6d; text-transform: uppercase;
  padding: 0 4px 6px;
}
.mn-sheet .mn-group { padding: 6px 0 10px; }
.mn-sheet .mn-group-h {
  font-size: 11px; letter-spacing: 3px; font-weight: 700;
  color: #55614f; text-transform: uppercase;
  padding: 8px 4px 6px;
}
.mn-sheet .mn-row {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  width: 100%; text-align: left;
  padding: 14px 12px; border-radius: 12px;
  color: var(--text); font-size: 17px; font-weight: 500;
  background: transparent; border: 0; font-family: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mn-sheet .mn-row:active { background: #141914; }
.mn-sheet .mn-row svg { width: 24px; height: 24px; color: #8b978b; flex: 0 0 auto; }
.mn-sheet .mn-row.active { color: var(--accent); font-weight: 600; }
.mn-sheet .mn-row.active svg { color: var(--accent); filter: drop-shadow(0 0 10px #9ef01a88); }
.mn-sheet .mn-row.active::before {
  content: "";
  position: absolute; left: -6px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 12px 1px #9ef01aaa;
}
.mn-sheet .mn-danger { color: var(--danger); }
.mn-sheet .mn-danger svg { color: var(--danger); }

.mn-sheet .mn-langs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 4px 2px 2px;
}
.mn-sheet .mn-langs button {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: #10141058;
  color: var(--text); font-size: 15px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mn-sheet .mn-langs button svg { width: 30px; height: 20px; border-radius: 3px; flex: 0 0 auto; }
.mn-sheet .mn-langs button.on {
  border-color: var(--accent);
  box-shadow: 0 0 22px -10px #9ef01aaa, 0 0 0 1px #9ef01a55 inset;
  color: var(--accent);
}

@media (min-width: 861px) {
  .mn-sheet, .mn-sheet-backdrop { display: none; }
}

/* ---------- Auth buttons in the top bar ---------- */
header.nav .chip-signin,
header.nav .btn-join {
  display: inline-flex; align-items: center; gap: 8px;
}
header.nav .chip-signin svg,
header.nav .btn-join svg { flex: 0 0 auto; }

@media (max-width: 860px) {
  header.nav .nav-right { display: flex; align-items: center; gap: 10px; }
  header.nav .chip-signin {
    padding: 0; width: 42px; height: 42px;
    justify-content: center; border-radius: 12px;
  }
  header.nav .chip-signin .chip-label { display: none; }
  header.nav .btn-join { padding: 0 16px; height: 42px; border-radius: 12px; font-weight: 700; }
}

/* ---------- Drag-to-dismiss grip ---------- */
.mn-sheet .mn-grip {
  position: relative;
  cursor: grab;
  touch-action: none;
}
.mn-sheet .mn-grip::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 160px; height: 40px;
}
.mn-sheet .mn-sheet-title { touch-action: none; cursor: grab; user-select: none; }
body.mn-sheet-open { overflow: hidden; }

/* ==========================================================================
   v27 — logo-only header, icon-only sign in, hero + mobile settings polish
   ========================================================================== */

/* Sign in is icon-only everywhere */
header.nav .chip-signin .chip-label { display: none !important; }
header.nav .chip-signin { padding: 8px; justify-content: center; }

/* Logo only in the top bar (no REPHUB wordmark), slightly larger mark */
header.nav .brand-text { display: none !important; }
header.nav .brand { gap: 0; }
header.nav .brand-mark { width: 34px; height: 34px; }

@media (max-width: 860px) {
  header.nav .brand-mark {
    width: 34px; height: 34px;
    padding: 6px; box-sizing: content-box;
    border: 1px solid #223022; border-radius: 13px;
    background: #0e120e;
    box-shadow: 0 0 20px -8px #9ef01a88, 0 1px 0 #ffffff0a inset;
  }
}

/* ---------- Hero ---------- */
.hero .hero-title {
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.hero .hero-sub { max-width: 56ch; line-height: 1.6; }
@media (max-width: 860px) {
  .hero { padding-top: 8px; }
  .hero .hero-title { font-size: 32px !important; }
  .hero .hero-sub { font-size: 14.5px; }
  .hero .tag { font-size: 10.5px; letter-spacing: 2px; }
}
@media (max-width: 380px) {
  .hero .hero-title { font-size: 28px !important; }
}

/* ---------- Settings on phones ---------- */
@media (max-width: 860px) {
  main.wrap > div:first-child h1 { font-size: 24px !important; }

  .rh-settings {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    margin-bottom: 24px;
  }
  .rh-settings-side { position: static; gap: 10px; min-width: 0; max-width: 100%; }
  .rh-settings-main { min-width: 0; max-width: 100%; }
  .rh-settings-side-title { display: none; }
  .rh-settings-help { display: none; }

  /* horizontal, swipeable tab strip */
  .rh-settings-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
    max-width: 100%;
    padding: 4px 16px 10px;
    margin: 0 -16px;
  }
  .rh-settings-nav::-webkit-scrollbar { display: none; }
  .rh-settings-nav-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
    gap: 8px;
    padding: 12px 4px !important;
    margin-right: 26px;
    border-radius: 0 !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted, #9aa39a);
  }
  .rh-settings-nav-btn.is-on {
    color: var(--accent);
    border-bottom-color: var(--accent) !important;
    background: transparent !important;
    box-shadow: none;
  }
  .rh-settings-nav-icon, .rh-settings-nav-icon svg { width: 18px; height: 18px; }


  /* stacked, comfortable cards */
  .rh-settings-main { gap: 12px; }
  .rh-settings-pane { gap: 12px; }
  .rh-card { padding: 16px; border-radius: 14px; }
  .rh-card-title { font-size: 14px; }
  .rh-pane-head { flex-direction: column; align-items: stretch; gap: 8px; padding: 2px 2px 4px; }
  .rh-pane-head h1 { font-size: 20px; }
  .rh-pane-head .muted { font-size: 12.5px; }
  .rh-view-profile { width: 100%; justify-content: center; }

  .rh-field-row, .rh-field-row--3, .rh-mp-media { grid-template-columns: 1fr !important; gap: 10px; }
  .rh-input, .rh-card select, .rh-card input, .rh-card textarea { font-size: 16px; }
  .rh-field label { font-size: 12.5px; }

  .rh-toggle-row { padding: 12px 0; font-size: 14.5px; }
  .rh-pay-grid { grid-template-columns: 1fr 1fr !important; }
  .rh-upload, .rh-upload--banner { grid-template-columns: 1fr !important; }
  .rh-upload-preview { max-width: 100%; }

  .rh-save-bar {
    position: sticky;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 22px);
    z-index: 20;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px; border-radius: 14px;
    border: 1px solid var(--border);
    background: #0b0e0bee;
    backdrop-filter: blur(10px);
  }
  .rh-save-bar .btn { flex: 1 1 auto; min-height: 44px; }
}

/* ---------- Image uploaders on phones (reference layout) ---------- */
@media (max-width: 860px) {
  /* card = [ title  ·  Change ] / image / hint */
  #banner-card, #avatar-card, .rh-mp-media > div {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 14px;
  }
  #banner-card > .rh-card-title,
  #avatar-card > .rh-card-title,
  .rh-mp-media > div > .rh-card-title { order: 1; padding-right: 76px; font-size: 15px; }
  #banner-card > [id$="-upload"],
  #avatar-card > [id$="-upload"],
  .rh-mp-media > div > [id$="-upload"] { order: 2; margin-top: 10px; }
  #banner-card > p.muted,
  #avatar-card > p.muted,
  .rh-mp-media > div > p.muted { order: 3; margin: 10px 0 0; font-size: 12px; line-height: 1.5; }

  .rh-upload,
  .rh-upload--banner,
  .rh-upload--circle,
  .rh-mp-media .rh-upload {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0;
    min-width: 0;
  }
  .rh-upload-preview {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    border-radius: 12px;
  }
  .rh-upload--circle .rh-upload-preview,
  .rh-mp-media .rh-upload--circle .rh-upload-preview {
    width: 132px !important;
    max-width: 132px !important;
    aspect-ratio: 1 / 1;
  }
  .rh-upload--banner .rh-upload-preview,
  .rh-mp-media .rh-upload-preview { aspect-ratio: 16 / 6; }

  /* the whole media block is the tap target — no drop zone / duplicate labels */
  .rh-upload-body { min-width: 0; display: contents; }
  .rh-upload-label,
  .rh-upload-hint,
  .rh-upload-drop { display: none !important; }

  /* "Change" as a green text link in the card header row */
  .rh-upload-actions {
    position: absolute;
    top: 13px;
    right: 14px;
    align-items: center;
    line-height: 1.2;
    display: flex;
    gap: 12px;
    z-index: 2;
  }
  .rh-upload-actions .btn {
    min-height: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    color: var(--accent) !important;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none !important;
  }
  .rh-upload-error { order: 4; font-size: 12.5px; margin-top: 8px; }

  /* About me card */
  #about-card > p.muted { font-size: 12px; margin: 4px 0 10px; }
  #about-card textarea { min-height: 84px; line-height: 1.5; }
  .rh-bio-count { text-align: right; margin-top: 8px; font-size: 12px; color: var(--muted, #9aa39a); }


  /* marketplace media block: same fields as desktop, just stacked */
  .rh-mp-media { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
  .rh-mp-media > div { min-width: 0; }
}

.rh-bio-count { text-align: right; margin-top: 8px; font-size: 12px; color: var(--muted, #9aa39a); }


/* ---------- Plain logo mark everywhere (no box / plate) ---------- */
.brand-mark {
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 0 8px #9ef01a55);
}
@media (max-width: 860px) {
  header.nav .brand-mark { width: 30px; height: 30px; }
}

/* ==========================================================================
   Notification bell + right-side drawer, and language picker in user menu
   ========================================================================== */
header.nav .nav-right { display: flex; align-items: center; gap: 10px; }


/* language picker inside the user dropdown */
.menu-pop .pop-langs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid #1e271e;
}
.menu-pop .pop-langs button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid #1e271e;
  background: #10150f;
  color: #d7e3d7;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
}
.menu-pop .pop-langs button svg { width: 22px; height: 15px; border-radius: 3px; }
.menu-pop .pop-langs button.on { border-color: var(--accent); color: #fff; }

/* right-side drawer */


@media (max-width: 860px) {
}

/* ==========================================================================
   v28 — navbar per reference: logo + wordmark + search, single role under name
   ========================================================================== */
header.nav .nav-lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
header.nav .brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
header.nav .brand-word {
  display: inline-block;
  font-size: 21px; font-weight: 800; letter-spacing: -.01em; color: #fff;
  line-height: 1;
}
header.nav .brand-word .accent { color: var(--accent); }

header.nav .nav-search {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  min-width: 0; flex: 1 1 320px; max-width: 340px;
  height: 40px; padding: 0 12px;
  border: 1px solid #1e271e; border-radius: 12px;
  background: #0d110d;
  color: #7f8b7f;
  transition: border-color .15s ease, box-shadow .15s ease;
}
header.nav .nav-search:focus-within { border-color: #35492f; box-shadow: 0 0 24px -14px #9ef01a99; }
header.nav .nav-search svg { flex: 0 0 auto; color: #7f8b7f; }
header.nav .nav-search input {
  flex: 1 1 auto; min-width: 0;
  background: none; border: 0; outline: none;
  color: #e6efe6; font-size: 14px; font-family: inherit;
}
header.nav .nav-search input::placeholder { color: #6e7a6e; }
header.nav .nav-search input::-webkit-search-cancel-button { display: none; }
header.nav .nav-search kbd {
  flex: 0 0 auto;
  font: 600 11px/1 inherit; color: #7f8b7f;
  padding: 4px 7px; border: 1px solid #1e271e; border-radius: 6px; background: #10150f;
}

@media (min-width: 861px) {
  header.nav { grid-template-columns: minmax(260px, 1fr) auto minmax(220px, 1fr); }
  header.nav .brand-text { display: none !important; }
  header.nav .brand-mark { width: 30px; height: 30px; }
}
@media (max-width: 1200px) {
  header.nav .nav-search { display: none; }
}
@media (max-width: 860px) {
  header.nav .brand-word { font-size: 18px; }
}

/* username + single highest role stacked in the user chip */
header.nav .chip-user-id {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: 2px; min-width: 0; line-height: 1.1;
}
header.nav .chip-user-id .uname {
  font-size: 14px; font-weight: 700; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
header.nav .nav-role {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  color: #a9b7a9; background: #141a14; border: 1px solid #1f291f;
  white-space: nowrap;
}
header.nav .nav-role--owner,
header.nav .nav-role--administrator,
header.nav .nav-role--admin { color: #ffd66b; background: #221c0c; border-color: #3b2f10; }
header.nav .nav-role--premium { color: #d3b4ff; background: #1b1330; border-color: #33244f; }
header.nav .nav-role--moderator,
header.nav .nav-role--staff { color: #8fd7ff; background: #0e1a22; border-color: #1b3242; }
header.nav .nav-role--verified,
header.nav .nav-role--vendor { color: var(--accent); background: #131a0e; border-color: #26331a; }

/* smaller avatar + badge icons in the top-right corner */
@media (min-width: 861px) {
  header.nav .chip-user { gap: 10px; padding: 5px 12px 5px 5px; }
  header.nav .chip-user img,
  header.nav .chip-user .chip-dot { width: 30px; height: 30px; }
}
header.nav .badge-row-inline { gap: 3px; }
header.nav .badge-pill .vbadge,
header.nav .badge-pill img.vbadge { width: 13px !important; height: 13px !important; }
header.nav .badge-more { font-size: 10px; }
