/* Shared responsive utility bar for authenticated pages outside the main Dashboard. */
body.fansflex-app .ff119-topbar {
  position: sticky;
  top: var(--ga-h, 0px);
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(170px, 430px) minmax(max-content, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 66px;
  padding: 9px 18px;
  color: #17324b;
  background: rgba(247, 250, 253, .96);
  border-bottom: 1px solid rgba(52, 83, 110, .17);
  box-shadow: 0 5px 18px rgba(26, 54, 78, .08);
  backdrop-filter: blur(14px);
}

body.fansflex-app .ff119-primary-tools,
body.fansflex-app .ff119-account-tools {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

body.fansflex-app .ff119-primary-tools { justify-self: start; }
body.fansflex-app .ff119-account-tools { justify-self: end; }

body.fansflex-app .ff119-primary-tools .ff88-theme-toggle {
  min-height: 42px;
  margin: 0;
  white-space: nowrap;
}
body.fansflex-app .ff119-primary-tools .ff88-theme-toggle [data-ff88-theme-label] { display: inline !important; }

body.fansflex-app .ff119-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  color: #fff !important;
  background: linear-gradient(135deg, #1768a8, #0c477e);
  border: 1px solid #2d79b7;
  border-radius: 11px;
  box-shadow: 0 5px 13px rgba(10, 68, 116, .2);
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}

body.fansflex-app .ff119-create ion-icon { font-size: 21px; }
body.fansflex-app .ff119-create:hover { filter: brightness(1.08); transform: translateY(-1px); }

body.fansflex-app .ff119-search {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  color: #22425f;
  background: #fff;
  border: 1px solid #c9d7e4;
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(27, 57, 83, .04);
}

body.fansflex-app .ff119-search:focus-within {
  border-color: #4387bd;
  box-shadow: 0 0 0 3px rgba(55, 130, 191, .16);
}

body.fansflex-app .ff119-search button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 34px;
  padding: 0;
  color: #244b6d;
  background: transparent;
  border: 0;
  font-size: 20px;
}

body.fansflex-app .ff119-search input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 6px;
  color: #183750;
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
}

body.fansflex-app .ff119-search input::placeholder { color: #71869a; opacity: 1; }

body.fansflex-app .ff119-icon-link,
body.fansflex-app .ff119-profile-link {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #163a59 !important;
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(101, 133, 159, .25);
  border-radius: 50%;
  text-decoration: none !important;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

body.fansflex-app .ff119-icon-link ion-icon { font-size: 21px; }
body.fansflex-app .ff119-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  color: #fff;
  background: #c94054;
  border: 2px solid #f7fafd;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
body.fansflex-app .ff119-icon-link:hover,
body.fansflex-app .ff119-profile-link:hover { color: #0875bd !important; background: #fff; transform: translateY(-1px); }
body.fansflex-app .ff119-profile-link img { display: block; width: 38px; height: 38px; border: 1px solid #9db3c5; border-radius: 50%; object-fit: cover; }

html[data-bs-theme="dark"] body.fansflex-app .ff119-topbar,
html[data-theme="dark"] body.fansflex-app .ff119-topbar {
  color: #e6f0f8;
  background: rgba(8, 28, 43, .96);
  border-bottom-color: rgba(132, 165, 192, .2);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
}

html[data-bs-theme="dark"] body.fansflex-app .ff119-search,
html[data-theme="dark"] body.fansflex-app .ff119-search {
  color: #dceaf6;
  background: #102c42;
  border-color: #3b5b73;
}

html[data-bs-theme="dark"] body.fansflex-app .ff119-search button,
html[data-theme="dark"] body.fansflex-app .ff119-search button,
html[data-bs-theme="dark"] body.fansflex-app .ff119-search input,
html[data-theme="dark"] body.fansflex-app .ff119-search input { color: #e5f0f8; }

html[data-bs-theme="dark"] body.fansflex-app .ff119-search input::placeholder,
html[data-theme="dark"] body.fansflex-app .ff119-search input::placeholder { color: #a8bfd1; }

html[data-bs-theme="dark"] body.fansflex-app .ff119-icon-link,
html[data-theme="dark"] body.fansflex-app .ff119-icon-link,
html[data-bs-theme="dark"] body.fansflex-app .ff119-profile-link,
html[data-theme="dark"] body.fansflex-app .ff119-profile-link {
  color: #e4eef7 !important;
  background: #102b40;
  border-color: #3a5b73;
}

html[data-bs-theme="dark"] body.fansflex-app .ff119-badge,
html[data-theme="dark"] body.fansflex-app .ff119-badge { border-color: #081c2b; }

/* Feed previously rendered its own partial toolbar; use the shared one above. */
body.fansflex-app.ff-route-feed .ff-topbar { display: none !important; }
/* Render the chosen logo through the actual img src, not CSS content replacement. */
body.fansflex-app.ff-route-feed .side-menu .ff-side-brand-full { content: normal !important; }

@media (max-width: 760px) {
  body.fansflex-app .ff119-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    min-height: 0;
    padding: 9px 12px 11px;
  }
  body.fansflex-app .ff119-primary-tools { grid-column: 1; grid-row: 1; gap: 7px; }
  body.fansflex-app .ff119-account-tools { grid-column: 2; grid-row: 1; gap: 6px; }
  body.fansflex-app .ff119-search { grid-column: 1 / -1; grid-row: 2; }
  body.fansflex-app .ff119-primary-tools .ff88-theme-toggle { min-height: 40px; padding-inline: 10px; }
  body.fansflex-app .ff119-create { min-height: 40px; padding-inline: 12px; }
  body.fansflex-app .ff119-icon-link,
  body.fansflex-app .ff119-profile-link { width: 40px; height: 40px; }
  body.fansflex-app .ff119-profile-link img { width: 36px; height: 36px; }
}

@media (max-width: 380px) {
  body.fansflex-app .ff119-primary-tools .ff88-theme-toggle [data-ff88-theme-label] { display: none; }
  body.fansflex-app .ff119-primary-tools .ff88-theme-toggle { width: 40px; justify-content: center; padding: 0; }
  body.fansflex-app .ff119-create span { font-size: 12px; }
}

@media (hover: none) {
  body.fansflex-app.ff-route-my-settings .profile-cover-bg .card-img-overlay,
  body.fansflex-app.ff-route-my-settings .avatar-holder .card-img-overlay {
    align-items: flex-start !important;
    justify-content: flex-end !important;
    padding: 9px !important;
    pointer-events: none;
  }
  body.fansflex-app.ff-route-my-settings .profile-cover-bg .actions-holder,
  body.fansflex-app.ff-route-my-settings .avatar-holder .actions-holder {
    display: flex !important;
    pointer-events: auto;
  }
}
