/* Instagram-inspired profile, create studio, file pickers, chat polish */

/* —— Profile —— */
.ig-profile {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 28px;
  width: 100%;
  box-sizing: border-box;
}

.ig-profile__cover {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f766e, #134e4a 45%, #115e59);
  border-radius: 0;
  margin: 0;
  width: 100%;
}

@media (min-width: 769px) {
  .ig-profile__cover {
    border-radius: 18px;
    height: 200px;
  }
}

.ig-profile__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-profile__cover-edit {
  display: none !important;
}

.ig-profile__body {
  padding: 0 16px;
  margin-top: -42px;
  position: relative;
  z-index: 2;
}

.ig-profile__header {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 16px !important;
  text-align: left !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ig-profile__avatar-wrap {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.ig-profile__avatar-wrap .avatar,
.ig-profile__avatar-wrap #profileAvatar {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  font-size: 28px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #d1d5db;
  color: #111;
  font-weight: 700;
}

.ig-profile__stats {
  flex: 1;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0 0 6px !important;
  padding: 0 !important;
  width: auto !important;
}

.ig-profile__stats .profile-stat {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  margin: 0;
  text-align: center;
  flex: 1;
  cursor: default;
  font: inherit;
  color: inherit;
}

.ig-profile__stats .profile-stat--link {
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.ig-profile__stats .profile-stat--link:active {
  background: rgba(0, 0, 0, 0.05);
}

.follow-list-sheet {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.follow-list-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.follow-list-sheet__panel {
  position: relative;
  max-height: min(78vh, 640px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16);
  padding-bottom: env(safe-area-inset-bottom);
}

.follow-list-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #d1d1d6;
  margin: 10px auto 6px;
}

.follow-list-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.follow-list-sheet__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.follow-list-sheet__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
  color: #8e8e93;
}

.follow-list-sheet__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px;
}

.follow-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.follow-list-row:active {
  background: rgba(0, 0, 0, 0.04);
}

.follow-list-row__meta {
  flex: 1;
  min-width: 0;
}

.follow-list-row__name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.follow-list-row__user {
  font-size: 13px;
  color: #8e8e93;
}

.follow-list-row__btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #007aff;
  color: #fff;
}

.follow-list-row__btn.is-following {
  background: #efefef;
  color: #111;
}

.follow-list-empty {
  padding: 40px 24px;
  text-align: center;
  color: #8e8e93;
  font-size: 14px;
}

.ig-profile__stats .profile-stat-value {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ig-profile__stats .profile-stat-label {
  display: block;
  font-size: 12px;
  color: #8e8e93;
  text-transform: lowercase;
  margin-top: 2px;
}

.ig-profile__identity {
  padding: 12px 0 4px;
  text-align: left !important;
}

.ig-profile__identity .profile-name {
  font-size: 16px !important;
  font-weight: 700 !important;
  margin: 0 0 2px !important;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ig-profile__identity .profile-meta {
  font-size: 13px !important;
  color: #8e8e93 !important;
  margin: 0 0 6px !important;
  text-align: left !important;
  max-width: 100% !important;
}

.ig-profile__identity .profile-bio {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  text-align: left !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.ig-profile__actions {
  display: flex !important;
  gap: 8px !important;
  padding: 10px 0 14px !important;
  width: 100% !important;
  justify-content: stretch !important;
}

.ig-profile__actions .btn,
.ig-profile__actions a.btn {
  flex: 1 1 0;
  min-height: 36px;
  border-radius: 12px !important;
  font-weight: 650;
  font-size: 14px;
  justify-content: center;
}

.ig-profile__actions .profile-more-btn {
  flex: 0 0 40px !important;
  min-width: 40px !important;
  width: 40px;
  border-radius: 12px !important;
}

#profileStoriesBar {
  padding: 0 12px 4px;
}

#profileStoriesBar .stories-bar,
#profileStoriesBar .profile-stories-bar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 4px 12px;
  border: 0 !important;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12) !important;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12) !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#profileStoriesBar .stories-bar::-webkit-scrollbar { display: none; }

.ig-profile .profile-tabs {
  display: flex;
  border-top: 0;
  margin: 0;
  padding: 0 8px;
}

.ig-profile .profile-tab {
  flex: 1;
  min-height: 44px;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: #8e8e93;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 8px;
}

.ig-profile .profile-tab .nav-icon,
.ig-profile .profile-tab .icon-svg {
  display: flex;
  width: 22px;
  height: 22px;
}

.ig-profile .profile-tab .nav-icon svg,
.ig-profile .profile-tab .icon-svg {
  width: 22px;
  height: 22px;
}

.ig-profile .profile-tab.active {
  color: #1c1c1e;
  border-bottom-color: #1c1c1e;
}

.ig-profile .profile-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 2px !important;
  width: 100%;
  background: transparent;
}

.ig-profile .profile-grid-item {
  aspect-ratio: 1;
  background: #e8ecf0;
  overflow: hidden;
}

.ig-profile .profile-grid-item img,
.ig-profile .profile-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-verified-label { display: none !important; }

@media (max-width: 768px) {
  .ig-profile {
    max-width: 100% !important;
    padding-bottom: calc(var(--bottom-nav-float, 76px) + 20px) !important;
  }

  .ig-profile__cover {
    height: 148px !important;
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    border-radius: 0 !important;
  }

  .ig-profile .profile-grid {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }
}

/* —— Custom file pickers —— */
.file-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--shell-border, var(--color-border));
  border-radius: 14px;
  background: var(--shell-bg, var(--color-bg));
  cursor: pointer;
}

.file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker__preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--shell-accent-soft, rgba(13,148,136,.12));
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.file-picker__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-picker__meta strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.file-picker__meta span {
  font-size: 13px;
  color: var(--shell-muted, #6b7a8c);
}

.file-picker--cover .file-picker__preview {
  width: 96px;
  height: 56px;
  border-radius: 10px;
}

/* —— Create studio —— */
body.ig-studio-open {
  overflow: hidden;
}

/* Kamera ochilganda past nav va header yashiriladi (+ tugmasi ustma-ust tushmasin) */
body.ig-studio-open .bottom-nav,
body.ig-studio-open #bottomNav.bottom-nav,
body.profile-page-active.ig-studio-open .bottom-nav,
body.profile-page-active.ig-studio-open #bottomNav.bottom-nav {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

body.ig-studio-open .mobile-top-bar,
body.ig-studio-open #mobileTopBar.mobile-top-bar {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ig-studio {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ig-studio.ig-studio--fullscreen {
  background: #000;
  align-items: stretch;
}

.ig-studio__sheet {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  color: #111;
}

.ig-studio__grab {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: #d1d5db;
  margin: 4px auto 14px;
}

.ig-studio__title {
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 4px;
  letter-spacing: -0.03em;
}

.ig-studio__subtitle {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.ig-studio__sheet--hub {
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
}

.ig-studio__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-bottom: 4px;
}

.ig-studio__section {
  margin: 10px 4px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

.ig-studio__choice {
  width: 100%;
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  min-height: 60px;
  color: inherit;
  text-decoration: none;
}

.ig-studio__choice:active { background: #f3f4f6; }

.ig-studio__choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ig-studio__choice-icon--teal { background: #0d7377; }
.ig-studio__choice-icon--ink { background: #1e293b; }
.ig-studio__choice-icon--soft { background: #334155; }

.ig-studio__choice strong { display: block; font-size: 15px; }
.ig-studio__choice small { color: #6b7280; font-size: 12.5px; line-height: 1.35; }

.ig-studio__cancel {
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: #f3f4f6;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.ig-camera,
.ig-compose,
.ig-music {
  position: absolute;
  inset: 0;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}

/* Live camera: full-bleed feed + transparent chrome overlays */
.ig-camera--live {
  display: block;
  overflow: hidden;
}

.ig-camera__viewport {
  position: absolute;
  inset: 0;
  background: #0a0a0a;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ig-camera__viewport--wide {
  /* Post: 16:9 stage centered */
}
.ig-camera__viewport--wide .ig-camera__video,
.ig-camera__viewport--wide .ig-camera__preview {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  position: relative;
  inset: auto;
}

.ig-camera__viewport--tall .ig-camera__video,
.ig-camera__viewport--tall .ig-camera__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-camera__video,
.ig-camera__preview {
  display: block;
  background: #0a0a0a;
}

.ig-camera__chrome {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 22%),
    linear-gradient(0deg, rgba(0,0,0,.72) 0%, transparent 42%);
}

.ig-camera__chrome * {
  pointer-events: auto;
}

.ig-camera__top,
.ig-compose__top,
.ig-music__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  position: relative;
  z-index: 2;
}

.ig-camera__label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
}

.ig-cam-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ig-cam-btn--dark {
  background: rgba(0,0,0,.06);
  color: #111;
}

.ig-camera__dock {
  padding: 0 0 calc(16px + env(safe-area-inset-bottom));
}

.ig-camera__perm {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ig-camera__perm[hidden] {
  display: none !important;
}

.ig-camera__perm p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255,255,255,.92);
  max-width: 280px;
  justify-self: center;
}

.ig-camera__perm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.ig-cam-retry {
  justify-self: center;
  min-height: 44px;
  min-width: 200px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ig-cam-retry--ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.55);
}

.ig-camera__bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 24px 4px;
}

.ig-cam-gallery {
  justify-self: start;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.92);
  background: rgba(255,255,255,.14);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.ig-cam-gallery__thumb {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,.08) center/cover no-repeat;
}

.ig-cam-gallery__thumb:not(.has-media)::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(#fff, #fff) center/16px 2px no-repeat,
    linear-gradient(#fff, #fff) center/2px 16px no-repeat;
  opacity: .9;
}

.ig-cam-gallery__thumb.has-media {
  font-size: 14px;
  color: #fff;
  display: grid;
  place-items: center;
}

.ig-cam-gallery__play {
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.ig-cam-flip {
  justify-self: end;
}

.ig-shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: transparent;
  position: relative;
  cursor: pointer;
  justify-self: center;
  touch-action: none;
  user-select: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 8px 24px rgba(0,0,0,.3);
}

.ig-shutter::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
  transition: inset .15s ease, border-radius .15s ease, background .15s ease;
}

.ig-shutter--video::after,
.ig-shutter.is-recording::after {
  inset: 20px;
  border-radius: 8px;
  background: #ef4444;
}

.ig-shutter.is-recording {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .28);
}

.ig-camera__modes {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 4px 20px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ig-camera__modes::-webkit-scrollbar { display: none; }

.ig-camera__modes button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.48);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
  padding: 8px 2px;
  white-space: nowrap;
  flex: 0 0 auto;
  text-shadow: 0 1px 6px rgba(0,0,0,.45);
  transition: color .15s ease, transform .15s ease;
}

.ig-camera__modes button.is-active {
  color: #fff;
  transform: scale(1.06);
}

.ig-camera__hint {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,.62);
  margin: 0 16px 2px;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}

.ig-cam-next {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  flex-shrink: 0;
}

.ig-cam-next--top {
  min-width: 72px;
}

.ig-cam-next:disabled {
  opacity: 0;
  pointer-events: none;
}

.ig-rec-badge {
  position: absolute;
  top: calc(58px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  font-size: 13px;
  font-weight: 700;
  z-index: 3;
}

.ig-rec-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: ig-pulse 1s ease infinite;
}

@keyframes ig-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* Gallery panel */
.ig-gallery-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #fafafa;
  color: #111;
  display: flex;
  flex-direction: column;
  animation: ig-sheet-up .22s ease;
}

@keyframes ig-sheet-up {
  from { transform: translateY(12%); opacity: .6; }
  to { transform: none; opacity: 1; }
}

.ig-gallery-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 12px;
  border-bottom: 1px solid #efefef;
  background: #fff;
}

.ig-gallery-panel__top strong {
  font-size: 16px;
  font-weight: 700;
}

.ig-gallery-panel__browse {
  border: 0;
  background: transparent;
  color: #0095f6;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 6px;
}

.ig-gallery-panel__grid {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.ig-gallery-tile {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: #e8e8e8;
  overflow: hidden;
  cursor: pointer;
}

.ig-gallery-tile img,
.ig-gallery-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-gallery-tile.is-active {
  outline: 3px solid #0095f6;
  outline-offset: -3px;
}

.ig-gallery-tile--add {
  display: grid;
  place-content: center;
  gap: 4px;
  background: #f3f4f6;
  color: #6b7280;
}

.ig-gallery-tile--add span {
  font-size: 28px;
  line-height: 1;
  color: #111;
}

.ig-gallery-tile--add small {
  font-size: 11px;
  font-weight: 600;
}

.ig-gallery-empty {
  grid-column: 1 / -1;
  margin: 48px 24px;
  padding: 36px 20px;
  border: 1.5px dashed #d1d5db;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  gap: 8px;
  cursor: pointer;
  color: #111;
}

.ig-gallery-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 4px;
}

.ig-gallery-empty strong { font-size: 16px; }
.ig-gallery-empty small { color: #6b7280; font-size: 13px; }

.ig-gallery-panel__hint {
  margin: 0;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: #8e8e93;
  background: #fff;
  border-top: 1px solid #efefef;
}

.ig-gallery-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ig-gallery-strip::-webkit-scrollbar { display: none; }

.ig-gallery-chip {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
  padding: 0;
  cursor: pointer;
}

.ig-gallery-chip.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}

.ig-gallery-chip img,
.ig-gallery-chip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-gallery-chip__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  background: rgba(0,0,0,.25);
}

.ig-compose__media--reel {
  aspect-ratio: 9/16;
  max-height: 42vh;
  margin-inline: auto;
  max-width: 220px;
}

/* Share-to-friends sheet */
.bingo-share-sheet {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bingo-share-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.bingo-share-sheet__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(72vh, 640px);
  background: #fff;
  color: #111;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,.2);
}

.bingo-share-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #d1d5db;
  margin: 10px auto 0;
}

.bingo-share-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

.bingo-share-sheet__x {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}

.bingo-share-sheet__list {
  overflow: auto;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom));
}

.bingo-share-sheet__loading,
.bingo-share-sheet__empty {
  padding: 28px 20px;
  text-align: center;
  color: #6b7280;
}

.bingo-share-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.bingo-share-row:active {
  background: #f3f4f6;
}

.bingo-share-row__av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e7eb;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 700;
}

.bingo-share-row__av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bingo-share-row__meta {
  flex: 1;
  min-width: 0;
}

.bingo-share-row__meta strong {
  display: block;
  font-size: 15px;
}

.bingo-share-row__meta small {
  color: #6b7280;
}

.bingo-share-row__send {
  color: #0ea5e9;
  font-weight: 700;
  font-size: 14px;
}

body.bingo-share-open {
  overflow: hidden;
}

.chat-bubble--post {
  max-width: min(280px, 78vw);
  padding: 0 !important;
  overflow: hidden;
  background: transparent !important;
}

.chat-post-card {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface, #fff);
  border: 1px solid rgba(0,0,0,.08);
  color: inherit;
  text-decoration: none;
}

.chat-post-card img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
  margin: 0 !important;
  border-radius: 0 !important;
}

.chat-post-card__body {
  padding: 10px 12px 12px;
}

.chat-post-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 4px;
}

.chat-post-card__text {
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ig-compose__share {
  border: 0;
  background: transparent;
  color: #0095f6;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 8px;
}

.ig-compose__share:disabled { opacity: .45; }

.ig-compose__icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ig-compose--sheet {
  background: #fff;
  color: #111;
}

.ig-compose--sheet .ig-compose__top {
  border-bottom: 1px solid #efefef;
  background: #fff;
}

.ig-compose__title {
  font-size: 16px;
  font-weight: 700;
}

.ig-compose__body {
  flex: 1;
  overflow: auto;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
  background: #fff;
}

.ig-compose__hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #efefef;
  align-items: start;
}

.ig-compose__media {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  position: relative;
}

.ig-compose__media img,
.ig-compose__media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ig-compose__caption-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ig-compose__user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: #262626;
}

.ig-compose__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: #efefef;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.ig-compose__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-compose textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  padding: 0;
  resize: none;
  min-height: 88px;
  outline: none;
}

.ig-compose textarea::placeholder { color: #8e8e93; }

.ig-compose__actions {
  display: flex;
  flex-direction: column;
}

.ig-compose__row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid #efefef;
  background: #fff;
  color: #111;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ig-compose__row--input {
  cursor: default;
}

.ig-compose__row-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #262626;
}

.ig-compose__row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ig-compose__row-text strong {
  font-size: 14px;
  font-weight: 650;
}

.ig-compose__row-text small {
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-compose__row-text input {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #111;
  padding: 0;
  outline: none;
  width: 100%;
}

.ig-compose__row-text input::placeholder { color: #8e8e93; }

.ig-compose__row-chev {
  color: #c7c7cc;
  font-size: 22px;
  line-height: 1;
}

/* —— IG-style new publication compose —— */
.ig-compose--ig {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111;
}

.ig-compose--ig .ig-compose__top-spacer {
  width: 40px;
  flex-shrink: 0;
}

.ig-compose--ig .ig-compose__body {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.ig-compose__preview {
  display: flex;
  justify-content: center;
  padding: 16px 16px 8px;
}

.ig-compose--ig .ig-compose__media {
  width: min(220px, 52vw);
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

.ig-compose--ig .ig-compose__media--story,
.ig-compose--ig .ig-compose__media--reel {
  aspect-ratio: 9 / 16;
  width: min(180px, 46vw);
}

.ig-compose--ig .ig-compose__media img,
.ig-compose--ig .ig-compose__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.ig-compose--ig textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 16px 12px;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: none;
  outline: none;
}

.ig-compose--ig .ig-compose__actions {
  border-top: 1px solid #efefef;
}

.ig-compose__music-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ig-compose__music-pills::-webkit-scrollbar { display: none; }

.ig-compose__music-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
  padding: 6px 12px 6px 6px;
  border: 1px solid #dbdbdb;
  border-radius: 999px;
  background: #fafafa;
  font: inherit;
  font-size: 13px;
  color: #262626;
  cursor: pointer;
}

.ig-compose__music-pill.is-active {
  border-color: #0095f6;
  background: rgba(0, 149, 246, 0.08);
}

.ig-compose__music-pill-art {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #e5e5ea;
  font-size: 12px;
}

.ig-compose__music-pill-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-compose__music-loading {
  font-size: 13px;
  color: #8e8e93;
  padding: 0 16px 8px;
  display: block;
}

.ig-compose__loc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.ig-compose__loc-chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #efefef;
  color: #262626;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ig-compose__loc-chip.is-active {
  background: #262626;
  color: #fff;
}

.ig-compose__footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #efefef;
  background: #fff;
}

.ig-compose__share-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #0095f6;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.ig-compose__share-btn:disabled {
  opacity: 0.45;
}

.ig-compose__watermark {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 13%;
  height: auto;
  pointer-events: none;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 1;
}

.ig-compose__media.is-processing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.ig-options-panel {
  z-index: 14;
}

.ig-options-panel__hint,
.ig-options-panel__note {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 13px;
  line-height: 1.45;
  color: #8e8e93;
}

.ig-options-panel__note {
  padding-top: 8px;
  padding-bottom: 16px;
}

.ig-options-panel__list {
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.ig-options-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: #111;
  cursor: pointer;
  text-align: left;
}

.ig-options-panel__row.is-active {
  color: #0095f6;
  font-weight: 600;
}

.ig-options-panel__check {
  font-size: 16px;
  color: #0095f6;
}

.ig-music--light {
  background: #fff !important;
  color: #111 !important;
  z-index: 12;
}

.ig-music--light .ig-music__top {
  border-bottom: 1px solid #efefef;
  background: #fff;
  color: #111;
}

.ig-music--light .ig-compose__icon-btn { color: #111; }
.ig-music--light .ig-compose__share { color: #0095f6; }

.ig-music__source {
  margin: 0;
  padding: 8px 16px 0;
  font-size: 12px;
  color: #8e8e93;
}

.ig-music--light .ig-music__search input {
  background: #efefef;
  color: #111;
  border: 0;
}

.ig-music--light .ig-music__cat {
  background: #efefef;
  color: #262626;
}

.ig-music--light .ig-music__cat.is-active {
  background: #262626;
  color: #fff;
}

.ig-music--light .ig-music__row {
  color: #111;
  border-bottom: 1px solid #f2f2f2;
}

.ig-music--light .ig-music__row.is-active,
.ig-music--light .ig-music__row:active {
  background: rgba(0, 149, 246, 0.08);
}

.ig-music--light .ig-music__meta small { color: #8e8e93; }
.ig-music--light .ig-music__use { color: #0095f6; }
.ig-music--light .ig-music__empty { color: #8e8e93; opacity: 1; }

.ig-music__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.ig-music__art--avatar {
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #e5e5ea;
}

.ig-compose__row-ico--svg {
  display: grid;
  place-items: center;
}

.ig-compose__tagged {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
}

.ig-compose__tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: #efefef;
  font-size: 13px;
  color: #262626;
}

.ig-compose__tag-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #8e8e93;
  padding: 0 2px;
}

.ig-music-preview__hero {
  text-align: center;
  padding: 20px 16px 8px;
}

.ig-music-preview__art {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ig-music-preview__art--ph {
  display: grid;
  place-items: center;
  background: #e5e5ea;
  font-size: 32px;
  margin-left: auto;
  margin-right: auto;
}

.ig-music-preview__hero strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.ig-music-preview__hero small {
  color: #8e8e93;
  font-size: 14px;
}

.ig-music-preview__hint {
  text-align: center;
  font-size: 13px;
  color: #8e8e93;
  padding: 0 16px 12px;
  margin: 0;
}

.ig-music-preview__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 16px;
}

.ig-music-preview__play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #0095f6;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.ig-music-preview__controls input[type="range"] {
  flex: 1;
  min-width: 0;
}

.ig-music-preview__time {
  font-size: 13px;
  color: #8e8e93;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ig-sheet-panel {
  background: #fff !important;
  color: #111 !important;
}

.ig-sheet-panel .ig-music__top {
  border-bottom: 1px solid #efefef;
}

.ig-sheet-panel .ig-music__search input {
  background: #efefef;
  color: #111;
}

.ig-sheet-panel .ig-music__row {
  color: #111;
}

.ig-sheet-panel .ig-music__row.is-active,
.ig-sheet-panel .ig-music__row:active {
  background: #f3f4f6;
}

.ig-sheet-panel .ig-music__meta small { color: #8e8e93; }
.ig-sheet-panel .ig-music__use { color: #0095f6; }
.ig-sheet-panel .ig-music__empty { color: #8e8e93; }

.ig-music-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.ig-music-btn span:nth-child(2) { flex: 1; text-align: left; font-weight: 600; }

.ig-music__cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 12px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ig-music__cats::-webkit-scrollbar { display: none; }

.ig-music__cat {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ig-music__cat.is-active {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
}

.ig-music__search {
  padding: 0 16px 12px;
}

.ig-music__search input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 0;
  padding: 0 14px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font: inherit;
}

.ig-music__list {
  flex: 1;
  overflow: auto;
  padding: 0 8px calc(16px + env(safe-area-inset-bottom));
}

.ig-music__row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ig-music__row.is-active,
.ig-music__row:active { background: rgba(255,255,255,.08); }

.ig-music__art {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #fff;
}

.ig-music__meta { flex: 1; min-width: 0; }
.ig-music__meta strong { display: block; font-size: 14px; }
.ig-music__meta small { color: rgba(255,255,255,.55); font-size: 12px; }
.ig-music__use { font-size: 13px; font-weight: 700; color: #38bdf8; }
.ig-music__empty { text-align: center; opacity: .5; padding: 40px; }

@media (max-width: 380px) {
  .ig-compose__hero {
    grid-template-columns: 96px 1fr;
  }
}

.post-music {
  padding: 0 14px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--shell-text, #0f172a);
}

.story-viewer-music {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(48px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.45);
}

/* —— Chat polish —— */
@media (max-width: 768px) {
  .messages-layout {
    background: #fff !important;
  }
  .chat-list-header {
    font-size: 22px !important;
    font-weight: 750 !important;
    letter-spacing: -0.03em;
    padding: 8px 4px 12px !important;
  }
  .chat-item {
    border-radius: 14px;
    padding: 12px 10px !important;
  }
  .chat-window-header {
    border-bottom: 1px solid rgba(0,0,0,.06) !important;
  }
  .chat-bubble.sent {
    background: #0d9488 !important;
    color: #fff !important;
    border-bottom-right-radius: 4px !important;
  }
  .chat-bubble.received {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom-left-radius: 4px !important;
  }
  .chat-input-bar {
    border-top: 1px solid rgba(0,0,0,.06) !important;
    background: #fff !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
  }
  .chat-input-bar textarea {
    border-radius: 22px !important;
    background: #f1f5f9 !important;
    border: 0 !important;
    padding: 10px 14px !important;
  }
}
