
/* Instagram AU — polished functional screens */
#instagramAppScreen { position: relative; }

#instagramAppScreen .instagram-screen-content {
  padding-bottom: 76px;
  box-sizing: border-box;
}

#instagramAppScreen .ig-bottom-nav {
  position: absolute !important;
  left: 50% !important;
  bottom: 15px !important;
  transform: translateX(-50%);
  width: calc(100% - 42px) !important;
  height: 58px !important;
  min-height: 58px !important;
  flex: none !important;
  margin: 0 !important;
  border: 1px solid rgba(220,220,220,.8) !important;
  border-radius: 32px !important;
  background: rgba(255,255,255,.91) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 5px 22px rgba(0,0,0,.13);
  justify-content: space-around;
}

#instagramAppScreen .ig-nav-button {
  height: 56px !important;
  width: 20% !important;
  font-size: 23px !important;
  transition: transform .15s ease;
}
#instagramAppScreen .ig-nav-button:active { transform: scale(.88); }
#instagramAppScreen .ig-nav-button.active { color: #0095f6; }

#instagramAppScreen .instagram-screen-content .ig-functional-page {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 18px 15px 92px;
  background: #fff;
  color: #262626;
  scrollbar-width: none;
}
#instagramAppScreen .instagram-screen-content .ig-functional-page::-webkit-scrollbar {
  display: none;
}
#instagramAppScreen .instagram-screen-content .ig-functional-page h2 {
  margin: 3px 0 19px;
  color: #111;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.65px;
}

/* Explore */
#instagramAppScreen .ig-functional-search {
  height: 42px;
  border-radius: 12px;
  background: #efefef;
  padding: 0 15px;
  font-size: 14px;
  outline: none;
}
#instagramAppScreen .ig-functional-search:focus {
  box-shadow: 0 0 0 1px #c7c7c7;
}
#instagramAppScreen .ig-functional-account {
  min-height: 66px;
  padding: 10px 2px;
  border-bottom: 1px solid #f0f0f0;
}
#instagramAppScreen .ig-functional-avatar {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  background: linear-gradient(145deg,#f5d5df,#d7d9f8 55%,#f8dfc6);
  color: #333;
  font-size: 17px;
}
#instagramAppScreen .ig-functional-account strong {
  font-size: 14px;
  letter-spacing: -.15px;
}
#instagramAppScreen .ig-functional-account small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

/* Reels */
#instagramAppScreen .ig-functional-page[data-ig-functional-page="reels"] {
  padding: 12px 10px 88px;
}
#instagramAppScreen .ig-functional-page[data-ig-functional-page="reels"] h2 {
  margin: 2px 5px 12px;
  font-size: 22px;
}
#instagramAppScreen .ig-functional-reel {
  position: relative;
  aspect-ratio: 9 / 14;
  max-height: 590px;
  min-height: 340px;
  margin: 0;
  border-radius: 13px;
  background: linear-gradient(155deg,#252331,#111 58%,#30242e);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
#instagramAppScreen .ig-functional-reel img,
#instagramAppScreen .ig-functional-reel video {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
#instagramAppScreen .ig-functional-reel::before {
  content: "Reels";
  position: absolute;
  z-index: 2;
  top: 17px;
  left: 16px;
  color: white;
  font-size: 20px;
  font-weight: 750;
  text-shadow: 0 1px 8px #000;
}
#instagramAppScreen .ig-functional-reel::after {
  content: "♡\\A  ◯\\A  ➤\\A  ⋯";
  white-space: pre;
  position: absolute;
  z-index: 2;
  right: 13px;
  bottom: 22px;
  color: white;
  font-size: 27px;
  line-height: 1.9;
  text-shadow: 0 1px 8px #000;
}
#instagramAppScreen .ig-functional-page[data-ig-functional-page="reels"] > p {
  padding: 10px 5px;
  text-align: left;
  font-size: 12px;
}

/* Profile */
#instagramAppScreen .ig-functional-page[data-ig-functional-page="profile"] h2 {
  margin-bottom: 12px;
  font-size: 19px;
}
#instagramAppScreen .ig-functional-profile-head {
  gap: 16px;
  padding: 10px 0 18px;
}
#instagramAppScreen .ig-functional-profile-head .ig-functional-avatar {
  width: 86px;
  height: 86px;
  flex-basis: 86px;
  border: 1px solid #eee;
  padding: 2px;
  background-clip: content-box;
}
#instagramAppScreen .ig-functional-stats {
  gap: 8px;
  font-size: 12px;
}
#instagramAppScreen .ig-functional-stats strong {
  margin-bottom: 3px;
  font-size: 17px;
  font-weight: 700;
}
#instagramAppScreen .ig-functional-page[data-ig-functional-page="profile"] > strong {
  display: block;
  margin: 2px 0 5px;
  font-size: 13px;
}
#instagramAppScreen .ig-functional-page[data-ig-functional-page="profile"] > p {
  margin: 4px 0 15px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
#instagramAppScreen .ig-functional-profile-post {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin-top: 12px;
  border: 1px solid #fff;
}
#instagramAppScreen .ig-functional-empty {
  color: #8e8e8e;
  font-size: 13px;
}


/* Bottom navigation icon details */
#instagramAppScreen .ig-bottom-nav .ig-nav-button svg {
  display: block;
  width: 25px;
  height: 25px;
  margin: auto;
  overflow: visible;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Messages"] svg {
  width: 25px;
  height: 25px;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Search"] svg {
  width: 25px;
  height: 25px;
}
#instagramAppScreen .ig-nav-avatar-wrap {
  position: relative;
  display: block;
  width: 23px;
  height: 23px;
  margin: auto;
}
#instagramAppScreen .ig-nav-profile-photo {
  display: block;
  width: 23px;
  height: 23px;
  border: 0 !important;
  border-radius: 50%;
  object-fit: cover;
}
#instagramAppScreen .ig-nav-avatar-fallback {
  display: block;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: linear-gradient(135deg,#f4c9d8,#d8d5f6,#f5dfc4);
}
#instagramAppScreen .ig-nav-active-dot {
  position: absolute;
  right: -2px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #ff3040;
}
#instagramAppScreen .ig-nav-profile-nav,
#instagramAppScreen .ig-bottom-nav .ig-profile-nav {
  font-size: 0 !important;
}


/* Final bottom-nav alignment and icon sizing */
#instagramAppScreen .ig-bottom-nav .ig-nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Messages"] svg {
  width: 23px;
  height: 23px;
  transform: translateY(-1px);
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Search"] svg {
  width: 25px;
  height: 25px;
}
#instagramAppScreen .ig-nav-avatar-wrap {
  width: 23px;
  height: 23px;
}
#instagramAppScreen .ig-nav-avatar-fallback {
  width: 23px;
  height: 23px;
  border: 1px solid #262626;
  box-sizing: border-box;
}
#instagramAppScreen .ig-nav-active-dot {
  right: -2px;
  bottom: -1px;
}


/* Unified Instagram bottom navigation icons */
#instagramAppScreen .ig-bottom-nav .ig-nav-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button svg {
  display: block !important;
  width: 25px !important;
  height: 25px !important;
  overflow: visible;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Messages"] svg {
  width: 24px !important;
  height: 24px !important;
  transform: none !important;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Search"] svg {
  width: 24px !important;
  height: 24px !important;
}
#instagramAppScreen .ig-nav-avatar-wrap {
  position: relative;
  display: block;
  width: 23px;
  height: 23px;
  margin: auto;
}
#instagramAppScreen .ig-nav-profile-photo,
#instagramAppScreen .ig-nav-avatar-fallback {
  display: flex;
  width: 23px;
  height: 23px;
  box-sizing: border-box;
  border-radius: 50%;
  object-fit: cover;
}
#instagramAppScreen .ig-nav-avatar-fallback {
  align-items: center;
  justify-content: center;
  border: 1.5px solid #262626;
  color: #262626;
}
#instagramAppScreen .ig-nav-avatar-fallback svg {
  width: 15px;
  height: 15px;
}
#instagramAppScreen .ig-nav-active-dot {
  position: absolute;
  right: -2px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  border: 1.5px solid white;
  border-radius: 50%;
  background: #ff3040;
}


/* Profile avatar: true circular image crop */
#instagramAppScreen .ig-functional-profile-head .ig-functional-avatar {
  box-sizing: border-box;
  width: 86px;
  height: 86px;
  flex: 0 0 86px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background-clip: border-box;
  clip-path: circle(50%);
}

#instagramAppScreen .ig-functional-profile-head .ig-functional-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.05);
  transform-origin: center;
}


/* Profile category: subtle Instagram-style label beneath the photo */
#instagramAppScreen .ig-functional-profile-avatar-column {
  display: flex;
  flex: 0 0 86px;
  min-width: 0;
  flex-direction: column;
  align-items: center;
}

#instagramAppScreen .ig-functional-profile-avatar-column .ig-functional-avatar {
  flex: 0 0 86px;
}

#instagramAppScreen .ig-functional-profile-category {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 11px;
  padding-left: 3px;
  color: #8e8e8e;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: anywhere;
}


/* Align bottom edges of navigation icons */
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Reels"] svg {
  transform: translateY(1px) !important;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Messages"] svg {
  transform: translateY(2px) !important;
}
#instagramAppScreen .ig-bottom-nav .ig-nav-button[aria-label="Search"] svg {
  transform: translateY(2.5px) !important;
}


/* Search / Explore page — scoped to the Search screen only */
#instagramAppScreen [data-ig-functional-page="search"] {
  padding: 12px 0 76px;
}

#instagramAppScreen .ig-search-explore {
  width: 100%;
  color: #171717;
}

#instagramAppScreen .ig-search-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 14px;
}

#instagramAppScreen .ig-search-meta-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 43px;
  padding: 0 12px;
  gap: 8px;
  border-radius: 13px;
  background: #efefef;
}

#instagramAppScreen .ig-search-magnifier {
  color: #777;
  font-size: 25px;
  line-height: 1;
  transform: rotate(-20deg);
}

#instagramAppScreen .ig-search-meta-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #171717;
  font-size: 14px;
}

#instagramAppScreen .ig-search-meta-input::placeholder {
  color: #777;
  opacity: 1;
}

#instagramAppScreen .ig-search-saved {
  flex: 0 0 auto;
  border: 0;
  padding: 8px 2px;
  background: transparent;
  color: #171717;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#instagramAppScreen .ig-search-saved.is-active {
  color: #777;
}

#instagramAppScreen .ig-search-topics {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 16px;
  scrollbar-width: none;
}

#instagramAppScreen .ig-search-topics::-webkit-scrollbar {
  display: none;
}

#instagramAppScreen .ig-search-topic {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  color: #333;
  font-size: 12px;
  white-space: nowrap;
}

#instagramAppScreen .ig-search-topic.is-active {
  border-color: #171717;
  background: #171717;
  color: #fff;
}

#instagramAppScreen .ig-search-heading {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 19px;
  font-weight: 700;
}

#instagramAppScreen .ig-search-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(105px, 31vw);
  gap: 2px;
}

#instagramAppScreen .ig-search-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #f2f0ef, #e5e3e2);
}

#instagramAppScreen .ig-search-tile:nth-child(3n + 2) {
  background: linear-gradient(145deg, #e9e9e7, #f4f2f0);
}

#instagramAppScreen .ig-search-tile:nth-child(3n) {
  background: linear-gradient(145deg, #eeecea, #e2e3e1);
}

#instagramAppScreen .ig-search-tile.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#instagramAppScreen .ig-search-tile-label {
  max-width: 90%;
  color: #999;
  font-size: 11px;
  text-align: center;
}

#instagramAppScreen .ig-search-results {
  padding: 4px 14px 20px;
}

#instagramAppScreen .ig-search-saved-view {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}

#instagramAppScreen .ig-search-saved-view[hidden],
#instagramAppScreen .ig-search-explore-content[hidden],
#instagramAppScreen .ig-search-results[hidden] {
  display: none !important;
}

#instagramAppScreen .ig-search-saved-symbol {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 15px;
  border: 2px solid #222;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
}

#instagramAppScreen .ig-search-saved-view h2 {
  margin: 0 0 7px;
  font-size: 20px;
}

#instagramAppScreen .ig-search-saved-view p {
  margin: 0;
  color: #888;
  font-size: 13px;
}


/* Search top row — reference-matched proportions */
#instagramAppScreen .ig-search-top {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 16px 16px;
}

#instagramAppScreen .ig-search-meta-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  height: 44px;
  min-width: 0;
  padding: 0 15px 0 42px;
  border: 0;
  border-radius: 13px;
  background: #efefef;
  box-sizing: border-box;
}

#instagramAppScreen .ig-search-meta-wrap::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 13px;
  width: 13px;
  height: 13px;
  border: 1.8px solid #737373;
  border-radius: 50%;
  box-sizing: border-box;
}

#instagramAppScreen .ig-search-meta-wrap::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 26px;
  width: 6px;
  height: 1.8px;
  border-radius: 2px;
  background: #737373;
  transform: rotate(45deg);
  transform-origin: left center;
}

#instagramAppScreen .ig-search-meta-input {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #262626;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  box-shadow: none;
}

#instagramAppScreen .ig-search-meta-input::placeholder {
  color: #777;
  opacity: 1;
}

#instagramAppScreen .ig-search-saved {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #171717;
  cursor: pointer;
}

#instagramAppScreen .ig-search-saved svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#instagramAppScreen .ig-search-saved.is-active {
  color: #777;
}


/* Search header — match the selected Instagram reference */
#instagramAppScreen .ig-search-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px 16px;
}

#instagramAppScreen .ig-search-meta-wrap {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  gap: 10px;
  border-radius: 14px;
  background: #efefef;
  box-sizing: border-box;
}

#instagramAppScreen .ig-search-meta-wrap::before,
#instagramAppScreen .ig-search-meta-wrap::after {
  content: none !important;
  display: none !important;
}

#instagramAppScreen .ig-search-meta-mark {
  display: flex;
  flex: 0 0 25px;
  width: 25px;
  height: 20px;
  align-items: center;
  justify-content: center;
}

#instagramAppScreen .ig-search-meta-mark svg {
  display: block;
  width: 25px;
  height: 16px;
}

#instagramAppScreen .ig-search-meta-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #262626;
  font-size: 14px;
  font-weight: 400;
}

#instagramAppScreen .ig-search-meta-input::placeholder {
  color: #777;
  opacity: 1;
}

#instagramAppScreen .ig-search-saved {
  flex: 0 0 26px;
  width: 26px;
  height: 42px;
  padding: 0;
}

#instagramAppScreen .ig-search-saved svg {
  width: 24px;
  height: 24px;
}


/* Search field: thin, blank, and without Meta AI decoration */
#instagramAppScreen .ig-search-meta-wrap {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 13px !important;
  gap: 0 !important;
  border-radius: 11px !important;
  background: #efefef !important;
}

#instagramAppScreen .ig-search-meta-mark {
  display: none !important;
}

#instagramAppScreen .ig-search-meta-input {
  display: block !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

#instagramAppScreen .ig-search-meta-input::-webkit-search-decoration,
#instagramAppScreen .ig-search-meta-input::-webkit-search-cancel-button {
  display: none !important;
}


/* Search bar: final clean styling */
#instagramAppScreen .ig-search-meta-wrap {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 13px !important;
  gap: 0 !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: #efefef !important;
  box-shadow: none !important;
}

#instagramAppScreen .ig-search-meta-wrap::before,
#instagramAppScreen .ig-search-meta-wrap::after {
  content: none !important;
  display: none !important;
}

#instagramAppScreen .ig-search-meta-mark {
  display: none !important;
}

#instagramAppScreen .ig-search-meta-input {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}


/* Search refinements: faint magnifier and slightly smaller topic chips */
#instagramAppScreen .ig-search-meta-wrap {
  position: relative !important;
  padding-left: 36px !important;
}

#instagramAppScreen .ig-search-meta-wrap::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 13px !important;
  top: 50% !important;
  width: 11px !important;
  height: 11px !important;
  border: 1.5px solid #b8b8b8 !important;
  border-radius: 50% !important;
  transform: translateY(-58%) !important;
  box-sizing: border-box !important;
}

#instagramAppScreen .ig-search-meta-wrap::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 24px !important;
  top: 50% !important;
  width: 5px !important;
  height: 1.5px !important;
  border-radius: 2px !important;
  background: #b8b8b8 !important;
  transform: translateY(3px) rotate(45deg) !important;
  transform-origin: left center !important;
}

#instagramAppScreen .ig-search-topics {
  gap: 7px !important;
}

#instagramAppScreen .ig-search-topic {
  padding: 7px 11px !important;
  font-size: 11.5px !important;
}


/* Search: smaller Explore heading and square post thumbnails */
#instagramAppScreen .ig-search-heading {
  font-size: 17px !important;
}

#instagramAppScreen .ig-search-grid {
  grid-auto-rows: auto !important;
}

#instagramAppScreen .ig-search-tile {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
}

/* Search Explore post management */
.ig-search-post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ig-search-tile.is-manage-mode {
  position: relative;
}
.ig-search-tile-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ig-search-tile-delete:disabled {
  opacity: 0.5;
  cursor: wait;
}
