
/* One shell layout; mobile only changes placement and navigation. */

header.app-shell {
  position: sticky;
  top: 0;
  z-index: 1200;
  width: 100%;
  background: color-mix(in srgb, var(--gobbo-accent) 30%, var(--gobbo-surface));
  border-bottom: 1px solid color-mix(in srgb, var(--gobbo-accent) 50%, var(--gobbo-surface));
}

.desktop-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 94%;
  margin-inline: auto;
  min-height: 48px;
  padding-block: 3px;
  max-height: 64px;
  overflow: hidden;
  transition: max-height .2s ease, min-height .2s ease, padding .2s ease, opacity .15s ease, transform .2s ease;
}

@media (min-width: 769px) {
  header.app-shell.nav-row-hidden .desktop-shell {
    max-height: 0;
    min-height: 0;
    padding-block: 0;
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
  }
}

header.app-shell.nav-row-hidden .mobile-shell {
  max-height: 0;
  min-height: 0;
  padding-block: 0;
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.mobile-shell,
nav.mobile-menu {
  display: none;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--gobbo-text);
  text-decoration: none;
}

.shell-brand img {
  display: block;
  width: auto;
  height: 30px;
}

.shell-brand span {
  font-size: 18px;
}

nav.desktop-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

nav.desktop-menu > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: var(--gobbo-muted);
  text-decoration: none;
  font-size: .92rem;
  white-space: nowrap;
}

nav.desktop-menu > a > i {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  font-size: 18px;
  line-height: 1;
}

nav.desktop-menu > a:is(.active, :hover) {
  color: var(--gobbo-accent);
  border-bottom: 1px solid currentColor;
}

.nav-search {
  display: flex;
  flex: 1;
  min-width: 120px;
  max-width: 460px;
  margin-inline: auto;
}

.nav-search input {
  min-width: 0;
}

.nav-search button {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 38px;
  padding: 0;
  flex-shrink: 0;
  border-left: 0;
}
.nav-search button i { width: 20px; height: 20px; font-size: 18px; line-height: 1; }
.nav-search input { height: 38px; }

.app-shell .notif-bell-btn,
.app-shell .profile-link,
#mobile-back {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gobbo-text);
}

.profile-link img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: cover;
}

.app-shell .profile-link i {
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 1;
}
.app-shell .notif-bell-btn svg { display: block; width: 20px; height: 20px; flex: 0 0 20px; }

.desktop-menu .profile-link > span {
  display: none;
}

/* The followed-creators strip belongs to the shared desktop header. */
.explore-following-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 94%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  margin: 0 auto;
  overflow: hidden;
  padding: 3px 0;
  border-top: 1px solid color-mix(in srgb, var(--gobbo-accent) 30%, transparent);
  scrollbar-width: none;
}
.explore-header-title {
  display: block;
  flex: 0 0 auto;
  width: max-content;
  min-width: 0;
  max-width: calc(100% - 300px);
  overflow: visible;
  color: var(--gobbo-muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .035em;
  text-overflow: clip;
  white-space: nowrap;
}
.explore-following-strip[hidden],
body[data-page="settings"] .explore-following-strip { display: none !important; }
.explore-following-strip > select {
  flex: 0 0 230px;
  width: 230px;
  min-width: 0;
  height: 32px;
  padding: 3px 8px;
  border-color: color-mix(in srgb, var(--gobbo-accent) 30%, transparent);
  background: color-mix(in srgb, var(--gobbo-accent) 8%, var(--gobbo-surface));
  color: var(--gobbo-muted);
  font-size: .78rem;
  text-align: left;
}
.explore-following-strip > select[hidden] { display: none !important; }
.explore-header-mode-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--gobbo-muted);
}
.explore-header-refresh {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--gobbo-muted);
}
.explore-header-refresh:hover,
.explore-header-refresh:focus-visible { border-color: color-mix(in srgb, var(--gobbo-accent) 35%, transparent); color: var(--gobbo-text); }
.explore-header-refresh.is-refreshing i { animation: explore-header-spin .7s linear infinite; }
@keyframes explore-header-spin { to { transform: rotate(360deg); } }
.explore-header-refresh:disabled { cursor: wait; opacity: .65; }
.explore-header-refresh-countdown { flex: 0 0 auto; color: var(--gobbo-muted); font-size: .68rem; white-space: nowrap; }
.explore-header-mode-toggle i {
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
}
.explore-header-mode-toggle:hover,
.explore-header-mode-toggle:focus-visible,
.explore-header-mode-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--gobbo-accent) 35%, transparent);
  color: var(--gobbo-text);
}
.explore-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.explore-following-strip > * { position: relative; }
.explore-following-strip > .explore-header-title { z-index: 1; }
.explore-header-content:hover,
.explore-header-content:focus-within { scrollbar-width: thin; }
.explore-header-content::-webkit-scrollbar { height: 0; }
.explore-header-content:hover::-webkit-scrollbar,
.explore-header-content:focus-within::-webkit-scrollbar { height: 5px; }
.explore-header-content::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--gobbo-accent) 65%, transparent); }
.explore-header-item {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  max-width: 280px;
  height: 36px;
  min-height: 36px;
  padding: 2px 8px;
  color: var(--gobbo-text);
  text-decoration: none;
  font-size: .86rem;
}
.explore-header-item:hover { background: color-mix(in srgb, var(--gobbo-accent) 18%, transparent); }
.explore-header-item img { display: block; width: 28px; height: 28px; flex: 0 0 28px; object-fit: cover; }
.explore-header-item-text { display: grid; gap: 1px; min-width: 0; }
.explore-header-item-text :is(strong, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explore-header-item-text { line-height: 1.05; }
.explore-header-item-text strong { color: var(--gobbo-text); font-size: .82rem; font-weight: 700; }
.explore-header-item-text small { color: var(--gobbo-muted); font-size: .68rem; }
.explore-header-note { flex: 0 0 auto; padding-inline: 8px; color: var(--gobbo-muted); font-size: .78rem; }
.explore-header-new {
  flex: 0 0 auto;
  padding: 2px 5px;
  background: color-mix(in srgb, var(--gobbo-accent) 24%, var(--gobbo-surface));
  color: var(--gobbo-accent);
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}
.explore-header-item.is-new { border-left: 2px solid var(--gobbo-accent); }
@media (max-width: 768px) {
  .explore-following-strip { display: none !important; }
}

#main-content {
  position: relative;
  width: 80%;
  margin-inline: auto;
  margin-top: 0;
  padding: 12px 0 var(--page-gutter);
  min-width: 0;
  isolation: isolate;
}

@media (min-width: 769px) and (max-width: 1100px) {
  .desktop-shell { gap: 8px; }
  nav.desktop-menu { flex-wrap: nowrap; }
  nav.desktop-menu > a { padding-inline: 6px; }
}

@media (max-width: 768px) {
  :root {
    --mobile-nav-size: calc(64px + env(safe-area-inset-bottom, 0px));
    --header-h: calc(49px + env(safe-area-inset-top, 0px));
    --nav-h: var(--mobile-nav-size);
  }

  /* Allow the document to scroll normally. */
  html,
  body {
    min-height: 100%;
    height: auto;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Hide scrollbar tracks without disabling scrolling. */
  html,
  body,
  body * {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  body *::-webkit-scrollbar {
    display: none;
  }

  /* Keep the mobile header available while scrolling upward. */
  header.app-shell {
    position: sticky;
    top: 0;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .desktop-shell {
    display: none;
  }

  .mobile-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    max-height: 64px;
    padding-inline: 12px;
    overflow: hidden;
    transition: max-height .2s ease, min-height .2s ease, padding .2s ease, opacity .15s ease, transform .2s ease;
  }

  .mobile-shell .shell-brand {
    margin-right: auto;
  }

  .mobile-shell .shell-brand img {
    height: 30px;
  }

  .mobile-shell .shell-brand span {
    font-size: 20px;
  }

  .mobile-shell :is(#mobile-back, .notif-bell-btn) {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  body[data-can-back="false"] #mobile-back {
    display: none;
  }

  /* Bottom navigation remains fixed while the page scrolls. */
  nav.mobile-menu {
    display: flex;
    position: fixed;
    inset: auto 0 0;
    height: var(--mobile-nav-size);
    padding: 0 12px env(safe-area-inset-bottom, 0px);
    align-items: center;
    justify-content: space-evenly;
    gap: 12px;
    background: color-mix(in srgb, var(--gobbo-accent) 18%, var(--gobbo-surface));
    border-top: 1px solid color-mix(in srgb, var(--gobbo-accent) 50%, var(--gobbo-surface));
    z-index: 1200;
  }

  nav.mobile-menu > a,
  nav.mobile-menu > button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 56px;
    height: 56px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--gobbo-muted);
    text-decoration: none;
  }

  nav.mobile-menu > a.active,
  nav.mobile-menu > button[aria-expanded="true"] {
    color: var(--gobbo-accent);
  }

  nav.mobile-menu :is(i, img) {
    font-size: 21px;
    width: 24px;
    height: 24px;
    object-fit: cover;
  }

  nav.mobile-menu .mnav-label {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Content flows below the header instead of using a fixed viewport panel. */
  #main-content {
    position: relative;
    inset: auto;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 12px;
    overflow: visible;
    overscroll-behavior-y: auto;
    scroll-padding: 12px;
    padding-bottom: calc(var(--nav-h) + 12px);
  }
}
