/* =========================================================================
   Social Tycoon — Instagram-style consumer theme ("Showcase", light)
   ========================================================================= */
:root {
  --ig-bg: #fff; --ig-text: #000; --ig-text-2: #737373; --ig-text-3: #a8a8a8;
  --ig-line: #dbdbdb; --ig-line-2: #efefef; --ig-soft: #fafafa;
  --ig-blue: #0095f6; --ig-blue-h: #1877f2; --ig-link: #00376b; --ig-red: #ff3040; --ig-err: #ed4956;
  --ig-btn: #efefef; --ig-btn-h: #dbdbdb; --ig-hover: rgba(0,0,0,.05); --ig-ring-gap: #fff;
  --ig-grad: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
  --ig-dm-me: #3797f0; --ig-dm-them: #efefef;
  /* elevated surfaces (menus, sheets, modals, the create dialog) and a few one-offs — dark redefines them */
  --ig-elev: #fff; --ig-line-e: #dbdbdb; --ig-line-e2: #efefef; --ig-soft-e: #fafafa; --ig-pop-sep: rgba(219,219,219,.3);
  --ig-on-text: #fff; --ig-warn: #b45309; --ig-err-bg: #fdecee;
  color-scheme: light;
  --ig-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ig-script: "Grand Hotel", "Brush Script MT", "Segoe Script", cursive;
  --ig-side-w: 244px; --ig-tab-h: 50px; --ig-mtop-h: 60px;
  /* shared views / widgets */
  --st-bg: #fff; --st-surface: #fff; --st-surface-2: #efefef; --st-hover: rgba(0,0,0,.05);
  --st-text: #000; --st-muted: #737373; --st-border: #dbdbdb;
  --st-primary: #0095f6; --st-on-primary: #fff; --st-danger: #ed4956; --st-success: #58c322;
  --st-radius: 8px; --st-radius-lg: 12px; --st-pill: 999px; --st-font: var(--ig-font); --st-shadow: none; --st-top: 0px;
}
/* Dark mode (More → Switch appearance): Instagram's dark palette — black canvas, #262626 menus / sheets / modals.
   <html data-theme="dark">, or data-appearance="device" on a dark device (appearance_attr()). */
:root[data-theme=dark] {
  color-scheme: dark;
  --ig-bg: #000; --ig-text: #f5f5f5; --ig-text-2: #a8a8a8; --ig-text-3: #737373;
  --ig-line: #262626; --ig-line-2: #262626; --ig-soft: #121212;
  --ig-link: #e0f1ff; --ig-err: #ff3040;
  --ig-btn: #363636; --ig-btn-h: #262626; --ig-hover: rgba(255,255,255,.1); --ig-ring-gap: #000; --ig-dm-them: #262626;
  --ig-elev: #262626; --ig-line-e: #363636; --ig-line-e2: #363636; --ig-soft-e: #363636; --ig-pop-sep: #363636;
  --ig-on-text: #000; --ig-warn: #f5a524; --ig-err-bg: rgba(255,48,64,.14);
  --st-bg: #000; --st-surface: #000; --st-surface-2: #262626; --st-hover: rgba(255,255,255,.1);
  --st-text: #f5f5f5; --st-muted: #a8a8a8; --st-border: #262626; --st-danger: #ff3040;
}
@media (prefers-color-scheme: dark) {
  :root[data-appearance=device] {
    color-scheme: dark;
    --ig-bg: #000; --ig-text: #f5f5f5; --ig-text-2: #a8a8a8; --ig-text-3: #737373;
    --ig-line: #262626; --ig-line-2: #262626; --ig-soft: #121212;
    --ig-link: #e0f1ff; --ig-err: #ff3040;
    --ig-btn: #363636; --ig-btn-h: #262626; --ig-hover: rgba(255,255,255,.1); --ig-ring-gap: #000; --ig-dm-them: #262626;
    --ig-elev: #262626; --ig-line-e: #363636; --ig-line-e2: #363636; --ig-soft-e: #363636; --ig-pop-sep: #363636;
    --ig-on-text: #000; --ig-warn: #f5a524; --ig-err-bg: rgba(255,48,64,.14);
    --st-bg: #000; --st-surface: #000; --st-surface-2: #262626; --st-hover: rgba(255,255,255,.1);
    --st-text: #f5f5f5; --st-muted: #a8a8a8; --st-border: #262626; --st-danger: #ff3040;
  }
}
/* Elevated surfaces read the elevated palette (identical to the page's in light) */
.ig-pop, .ig-sheet-card, .ig-modal-card, .ig-create, #st-report, .tk-dialog {
  --ig-bg: var(--ig-elev); --ig-ring-gap: var(--ig-elev); --ig-line: var(--ig-line-e); --ig-line-2: var(--ig-line-e2); --ig-soft: var(--ig-soft-e);
  --st-surface: var(--ig-elev); --st-border: var(--ig-line-e);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body { background: var(--ig-bg); color: var(--ig-text); font: 14px/18px var(--ig-font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ig-blue); outline-offset: 2px; }
dialog { color: var(--ig-text); }
.ig-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ig-skip { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--ig-elev); padding: 8px 12px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.ig-skip:focus { left: 8px; }
.ig-muted { color: var(--ig-text-2); }
.ig-center { text-align: center; margin: 12px 0; }
.ig-inline { display: inline; margin: 0; }
.ig-link { color: var(--ig-blue); font-weight: 600; }
.ig-link:hover { color: var(--ig-link); }
.ig-hash { color: var(--ig-link); }
.ig-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Icons ---------- */
.ig-i { flex: none; display: block; }
.ig-i-12 { width: 12px; height: 12px; } .ig-i-16 { width: 16px; height: 16px; } .ig-i-18 { width: 18px; height: 18px; }
.ig-i-20 { width: 20px; height: 20px; } .ig-i-24 { width: 24px; height: 24px; } .ig-i-28 { width: 28px; height: 28px; }
.ig-i-32 { width: 32px; height: 32px; } .ig-i-40 { width: 40px; height: 40px; } .ig-i-44 { width: 44px; height: 44px; }
.ig-i-48 { width: 48px; height: 48px; } .ig-i-96 { width: 96px; height: 96px; }
/* utility sizes used by icon() defaults in the shared views */
svg[class*="w-"], svg[class*="h-"] { flex: none; }
.w-3 { width: 12px; } .h-3 { height: 12px; } .w-4 { width: 16px; } .h-4 { height: 16px; } .w-5 { width: 20px; } .h-5 { height: 20px; }
.w-6 { width: 24px; } .h-6 { height: 24px; } .w-8 { width: 32px; } .h-8 { height: 32px; }

/* ---------- Buttons ---------- */
.ig-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 16px; border: 0; border-radius: 8px;
  background: var(--ig-btn); color: var(--ig-text); font-size: 14px; font-weight: 600; line-height: 18px; white-space: nowrap; cursor: pointer; transition: background .15s; }
.ig-btn:hover { background: var(--ig-btn-h); }
.ig-btn-primary { background: var(--ig-blue); color: #fff; }
.ig-btn-primary:hover { background: var(--ig-blue-h); }
.ig-btn-primary:disabled { opacity: .7; cursor: default; background: var(--ig-blue); }
.ig-btn-sm { height: 32px; padding: 0 16px; }
.ig-btn-block { width: 100%; }
.ig-btn-icon { width: 32px; padding: 0; }
.ig-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; flex: none; }
.ig-icon-btn:hover { opacity: .5; }
.ig-link-btn { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--ig-text-2); cursor: pointer; }
.ig-link-btn:hover { color: var(--ig-text); }
.ig-follow-form { display: inline; margin: 0; }
.ig-follow-link { border: 0; background: none; padding: 0; color: var(--ig-blue); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ig-follow-link:hover { color: var(--ig-link); }
.ig-follow-link.is-muted { color: var(--ig-text); }
.ig-follow-link.is-muted:hover { color: var(--ig-text-2); }
.ig-more-btn { border: 0; background: none; padding: 0; color: var(--ig-text-2); font-size: 14px; cursor: pointer; }
.ig-on { display: none; }
.is-on > .ig-on { display: block; }
.is-on > .ig-off { display: none; }
form.is-busy .ig-post-btn { opacity: .4; }

/* ---------- Avatars + story rings ---------- */
.ig-av { border-radius: 50%; object-fit: cover; background: var(--ig-line-2); flex: none; display: block; }
span.ig-av { display: inline-flex; }
.ig-ring { display: inline-flex; flex: none; border-radius: 50%; background: var(--ig-grad); line-height: 0; }
.ig-ring.is-seen { background: var(--ig-line); }
.ig-ring.is-none { background: transparent; }
.ig-ring-gap { display: inline-flex; border-radius: 50%; background: var(--ig-ring-gap); }
.ig-ring.is-none .ig-ring-gap { background: transparent; }
.ig-verified { display: inline-block; flex: none; margin-left: 4px; vertical-align: -2px; }
.ig-u { font-weight: 600; color: var(--ig-text); }
.ig-glyph { display: inline-grid; place-items: center; border-radius: 50%; background: var(--ig-grad); color: #fff; font-family: var(--ig-script); line-height: 1; flex: none; }
.ig-wordmark { font-family: var(--ig-script); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: .2px; white-space: nowrap; color: var(--ig-text); }

/* ---------- Badges ---------- */
.ig-badge { position: absolute; top: -7px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ig-red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--ig-bg); }
.ig-dot-badge { position: absolute; top: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--ig-red); box-shadow: 0 0 0 2px var(--ig-bg); }

/* ---------- Sidebar ---------- */
.ig-side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 40; width: var(--ig-side-w); display: flex; flex-direction: column;
  padding: 8px 12px 20px; background: var(--ig-bg); border-right: 1px solid var(--ig-line); container: igside / inline-size; }
.ig-side-logo { display: flex; align-items: flex-end; height: 92px; padding: 0 12px 20px; margin-bottom: 8px; flex: none; }
.ig-side-word { font-size: 31px; }
.ig-side-glyph { display: none; font: 34px/1 var(--ig-script); width: 24px; text-align: center; }
.ig-side-items { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.ig-side-items::-webkit-scrollbar { display: none; }
.ig-side-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px; margin: 2px 0; border: 0; border-radius: 8px; background: none;
  color: var(--ig-text); font-size: 16px; line-height: 24px; text-align: left; cursor: pointer; transition: background .15s; }
.ig-side-item:hover { background: var(--ig-hover); }
.ig-side-ic { position: relative; display: grid; place-items: center; width: 24px; height: 24px; flex: none; transition: transform .15s; }
.ig-side-item:hover .ig-side-ic { transform: scale(1.05); }
.ig-side-item.is-active .ig-side-label { font-weight: 700; }
.ig-side-label { white-space: nowrap; }
.ig-side-me { display: inline-flex; border-radius: 50%; }
.ig-side-me .ig-av { width: 24px !important; height: 24px !important; font-size: 10px !important; }
.is-active .ig-side-me, .ig-tab-item.is-active .ig-side-me { outline: 2px solid var(--ig-text); outline-offset: 1px; }
.ig-side-more { position: relative; flex: none; }
@container igside (max-width: 120px) {
  .ig-side-word, .ig-side-label { display: none; }
  .ig-side-glyph { display: block; }
  .ig-side-logo { justify-content: center; padding: 0 0 20px; }
  .ig-side-item { width: 48px; justify-content: center; margin-left: auto; margin-right: auto; }
}

/* Popovers (More menu, emoji picker) */
.ig-pop { position: absolute; z-index: 60; background: var(--ig-elev); border-radius: 16px; padding: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.04); }
.ig-more-menu { left: 0; bottom: calc(100% + 8px); width: 266px; }
.ig-pop-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 0; border-radius: 8px; background: none; color: var(--ig-text);
  font-size: 14px; line-height: 18px; text-align: left; cursor: pointer; }
.ig-pop-item:hover { background: var(--ig-hover); }
.ig-pop-sep { height: 6px; margin: 8px -8px; background: var(--ig-pop-sep); }
.ig-pop-form { margin: 0; }
/* Switch appearance (the More menu's second view; also in the phone "Settings and activity" sheet) */
.ig-more-menu.is-appear > :not(.ig-appear), .ig-sheet-card.is-appear > :not(.ig-appear) { display: none !important; }
.ig-appear-head { display: flex; align-items: center; gap: 8px; margin: 0 -8px 8px; padding: 4px 16px 12px 10px; border-bottom: 1px solid var(--ig-line); }
.ig-sheet-card .ig-appear-head { margin: 0; padding: 12px 16px 12px 10px; }
.ig-appear-back { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ig-text-2); cursor: pointer; }
.ig-appear-back:hover { background: var(--ig-hover); color: var(--ig-text); }
.ig-appear-title { flex: 1; font-size: 16px; line-height: 20px; font-weight: 700; }
.ig-appear-form { margin: 0; }
.ig-sheet-card .ig-appear-form { padding: 4px 8px 12px; }
.ig-appear-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 8px; cursor: pointer; }
.ig-appear-row:hover { background: var(--ig-hover); }
.ig-appear-row small { display: block; margin-top: 2px; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-switch { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 44px; height: 24px; margin: 0; border-radius: 12px; background: var(--ig-line-e); cursor: pointer; transition: background .15s; }
.ig-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s, background .15s; }
.ig-switch:checked { background: var(--ig-text); }
.ig-switch:checked::after { transform: translateX(20px); background: var(--ig-on-text); }
.ig-switch:focus-visible { outline: 2px solid var(--ig-blue); outline-offset: 2px; }

/* ---------- Slide-out panel (Search / Notifications) ---------- */
.ig-drawer { position: fixed; top: 0; bottom: 0; left: 72px; z-index: 39; display: flex; flex-direction: column; width: 397px; max-width: calc(100vw - 72px);
  background: var(--ig-bg); border-right: 1px solid var(--ig-line); border-radius: 0 16px 16px 0; box-shadow: 4px 0 24px rgba(0,0,0,.15); animation: ig-drawer-in .22s ease-out; }
@keyframes ig-drawer-in { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ig-drawer-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ig-drawer-title { padding: 24px 24px 20px; font-size: 24px; line-height: 30px; font-weight: 600; }
.ig-drawer-search { margin: 0 16px 24px; }
.ig-drawer-body { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--ig-line); padding: 8px 0; }
[data-panel="notifications"] .ig-drawer-body { border-top: 0; padding: 0 24px 16px; }
.ig-drawer-sub { display: flex; justify-content: space-between; align-items: center; padding: 8px 24px 8px; font-size: 16px; font-weight: 600; }
.ig-drawer-sub button { border: 0; background: none; padding: 0; color: var(--ig-blue); font-size: 14px; font-weight: 600; cursor: pointer; }
.ig-drawer-body .ig-user-row { padding: 8px 24px; }
.ig-drawer-body a.ig-user-row:hover, .ig-drawer-body .ig-user-row:hover { background: var(--ig-soft); }
.ig-drawer-empty { padding: 32px 24px; text-align: center; color: var(--ig-text-2); }
.ig-drawer-x { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: none; color: var(--ig-text-2); cursor: pointer; }
body.ig-drawer-open .ig-side { width: 72px; }
body.ig-drawer-open .ig-side .ig-side-item.is-active:not([data-drawer]) { font-weight: 400; }
.ig-side-item.is-drawer { box-shadow: inset 0 0 0 1px var(--ig-line); }
@media (max-width: 767px) { .ig-drawer { display: none !important; } }

/* ---------- Shell ---------- */
.ig-shell { margin-left: var(--ig-side-w); min-height: 100vh; }
.ig-main { display: block; min-width: 0; }
.ig-mtop, .ig-tabbar { display: none; }

/* ---------- Home: stories + feed + right column ---------- */
.ig-home { display: flex; justify-content: center; align-items: flex-start; gap: 64px; padding: 22px 16px 0; }
.ig-home-col { width: 100%; max-width: 630px; min-width: 0; }
.ig-feed { max-width: 470px; margin: 16px auto 0; }

.ig-stories { position: relative; }
.ig-stories-list { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-behavior: smooth; scrollbar-width: none; padding: 8px 0; }
.ig-stories-list::-webkit-scrollbar { display: none; }
.ig-story { position: relative; flex: none; width: 74px; }
.ig-story-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 0; border: 0; background: none; color: var(--ig-text); cursor: pointer; }
.ig-story-name { display: block; max-width: 74px; font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-story-name.is-muted { color: var(--ig-text-2); }
.ig-story-plus { position: absolute; left: 50px; top: 46px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 2px solid var(--ig-bg);
  border-radius: 50%; background: var(--ig-blue); color: #fff; cursor: pointer; }
.ig-stories-arrow { position: absolute; top: 29px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.96); color: #262626; box-shadow: 0 0 5px rgba(0,0,0,.25); cursor: pointer; }
.ig-stories-arrow.is-prev { left: 6px; }
.ig-stories-arrow.is-next { right: 6px; }

/* ---------- Feed post ---------- */
.ig-post { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--ig-line); }
.ig-post-head { display: flex; align-items: center; gap: 10px; padding: 0 0 12px 2px; min-width: 0; }
.ig-post-av { display: inline-flex; flex: none; border-radius: 50%; }
.ig-post-who { flex: 1; min-width: 0; }
.ig-post-line { display: flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.ig-post-line .ig-u { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ig-post-line .ig-follow-form { flex: none; }
.ig-post-line .ig-follow-link { font-size: 14px; }
.ig-dot { color: var(--ig-text-2); margin: 0 4px; flex: none; }
.ig-post-time { color: var(--ig-text-2); flex: none; }
.ig-post-sub { font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-post-more { width: 32px; height: 32px; margin-right: -6px; }
.ig-post-media { position: relative; overflow: hidden; border: 1px solid var(--ig-line); border-radius: 4px; background: var(--ig-line-2); }
.ig-post-media .ig-media { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; }
.ig-textcard { display: grid; place-items: center; padding: 32px; background: var(--ig-grad); color: #fff; font-size: 22px; line-height: 1.3; font-weight: 600; text-align: center; }
.ig-textcard .ig-hash { color: #fff; }
.ig-play-ov { position: absolute; left: 50%; top: 50%; z-index: 2; display: none; place-items: center; width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; pointer-events: none; }
.ig-play-ov .ig-i { margin-left: 6px; }
[data-video-root].is-paused .ig-play-ov { display: grid; }
.ig-mute { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 50%; background: rgba(38,38,38,.85); color: #fff; cursor: pointer; }
.ig-mute-on { display: none; }
html[data-muted="0"] .ig-mute-on { display: block; }
html[data-muted="0"] .ig-mute-off { display: none; }
.st-heart-burst { width: 110px; height: 110px; margin: -55px 0 0 -55px; }

.ig-post-body { min-width: 0; }
.ig-actions { display: flex; align-items: center; margin: 4px -8px 0; }
.ig-act { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border: 0; background: none; color: var(--ig-text); cursor: pointer; }
.ig-act:hover { color: var(--ig-text-2); }
.ig-act-like.is-on, .ig-act-like.is-on:hover { color: var(--ig-red); }
.ig-act-like.is-pop .ig-on { animation: ig-pop .45s ease; }
.ig-save { margin-left: auto; }
@keyframes ig-pop { 0% { transform: scale(1); } 25% { transform: scale(1.25); } 55% { transform: scale(.92); } 100% { transform: scale(1); } }
.ig-likes { margin: 2px 0 8px; }
.ig-likes b { font-weight: 600; }
.ig-likes-by { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.ig-likes-by .ig-av { margin-right: 2px; box-shadow: 0 0 0 1px var(--ig-bg); }
.ig-caption { margin-bottom: 8px; overflow-wrap: anywhere; }
.ig-caption .ig-u { margin-right: 1px; }
.ig-view-comments { display: block; margin-bottom: 8px; color: var(--ig-text-2); }
.ig-feed-comments .ig-fcomment { margin-bottom: 8px; overflow-wrap: anywhere; }
.ig-add-comment { position: relative; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.ig-add-comment textarea { flex: 1; min-width: 0; height: 18px; max-height: 80px; padding: 0; border: 0; outline: 0; resize: none; background: transparent;
  font-size: 14px; line-height: 18px; overflow-y: auto; }
.ig-add-comment textarea::placeholder { color: var(--ig-text-2); }
.ig-post-btn { flex: none; border: 0; background: none; padding: 0; color: var(--ig-blue); font-size: 14px; font-weight: 600; cursor: pointer; }
.ig-post-btn:hover { color: var(--ig-link); }
.ig-add-comment textarea:placeholder-shown ~ .ig-post-btn { display: none; }
.ig-detail-form textarea:placeholder-shown ~ .ig-post-btn { display: inline; opacity: .3; pointer-events: none; }
.ig-add-comment .ig-emoji-btn .ig-i { width: 14px; height: 14px; }
.ig-detail-form .ig-emoji-btn .ig-i { width: 24px; height: 24px; }
.ig-cta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -1px; padding: 12px; border: 1px solid var(--ig-line); border-top: 0;
  border-radius: 0 0 4px 4px; font-weight: 600; transition: background .3s, color .3s; }
.ig-cta:hover { background: var(--ig-blue); color: #fff; border-color: var(--ig-blue); }
.ig-post-media:has(+ .ig-cta) { border-radius: 4px 4px 0 0; }

/* Emoji picker */
.ig-emoji { position: relative; display: flex; flex: none; }
.ig-emoji-btn { display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ig-text); cursor: pointer; }
.ig-emoji-btn:hover { color: var(--ig-text-2); }
.ig-emoji-panel { right: -8px; bottom: calc(100% + 10px); width: 300px; padding: 12px; }
.ig-emoji.is-up .ig-emoji-panel { left: -8px; right: auto; }
.ig-emoji-title { color: var(--ig-text-2); font-weight: 600; margin: 0 4px 8px; }
.ig-emoji-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ig-emoji-grid button { border: 0; background: none; font-size: 24px; line-height: 36px; border-radius: 8px; padding: 0; cursor: pointer; }
.ig-emoji-grid button:hover { background: var(--ig-hover); }

/* Caught up + loader */
.ig-caught-up { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 0 56px; text-align: center; color: var(--ig-text-2); }
.ig-caught-up strong { color: var(--ig-text); font-size: 20px; line-height: 25px; font-weight: 400; margin-top: 8px; }
.ig-caught-up a { color: var(--ig-blue); font-weight: 600; margin-top: 8px; }
.ig-caught-ic { display: grid; place-items: center; width: 96px; height: 96px; border: 2px solid transparent; border-radius: 50%;
  background: linear-gradient(var(--ig-bg), var(--ig-bg)) padding-box, var(--ig-grad) border-box; color: #d62976; }
.ig-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: 28px 0; }
.ig-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--ig-line-2); border-top-color: var(--ig-text-2); animation: ig-spin .8s linear infinite; }
@keyframes ig-spin { to { transform: rotate(360deg); } }

/* ---------- Right column ---------- */
.ig-rail { position: sticky; top: 0; width: 319px; flex: none; padding: 36px 0 24px; }
.ig-rail-me, .ig-sugg { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.ig-rail-me { margin-bottom: 12px; }
.ig-sugg-av { display: inline-flex; flex: none; border-radius: 50%; }
.ig-sugg-main { flex: 1; min-width: 0; }
.ig-sugg-main .ig-u { display: inline-block; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ig-sugg-sub { color: var(--ig-text-2); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-rail-me .ig-sugg-sub { font-size: 14px; line-height: 18px; }
.ig-rail-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.ig-rail-head span { color: var(--ig-text-2); font-weight: 600; }
.ig-rail-head a { font-size: 12px; font-weight: 600; }
.ig-rail-head a:hover { color: var(--ig-text-2); }
.ig-foot { color: #c7c7c7; font-size: 12px; line-height: 16px; }
.ig-foot-copy { margin-top: 16px; }
/* Language picker: a native <select> laid invisibly over its label ("Language" / "English ⌄") */
.ig-lang { position: relative; display: inline-flex; align-items: center; gap: 2px; margin: 0; vertical-align: top; }
.ig-lang-label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ig-lang select { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; cursor: pointer; appearance: none; -webkit-appearance: none; }
.ig-lang:hover .ig-lang-label { text-decoration: underline; }
.ig-lang:focus-within { outline: 2px solid var(--ig-blue); outline-offset: 2px; border-radius: 2px; }
.ig-lang-go { margin-left: 6px; padding: 0 6px; border: 1px solid var(--ig-line); border-radius: 4px; background: none; font-size: 12px; }
.ig-auth-foot .ig-foot-copy, .ig-page-foot .ig-foot-copy { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
.ig-page-foot { margin-top: 48px; padding: 0 16px; text-align: center; color: var(--ig-text-2); }
.ig-rail-foot { margin-top: 28px; }

/* Compact embed (Boost preview, quotes) */
.ig-embed { max-width: 470px; overflow: hidden; border: 1px solid var(--ig-line); border-radius: 8px; background: var(--ig-bg); }
.ig-embed-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.ig-embed-media { aspect-ratio: 1; overflow: hidden; background: var(--ig-line-2); }
.ig-embed-media .ig-media { width: 100%; height: 100% !important; object-fit: cover; }
.ig-embed-cap { padding: 10px 12px 12px; overflow-wrap: anywhere; }

/* ---------- Post detail ---------- */
.ig-detail-page { max-width: 1060px; margin: 0 auto; padding: 32px 20px 48px; }
.ig-detail { --mw: min(598px, calc((100vh - 96px) * var(--ar, .8))); display: grid; grid-template-columns: minmax(0, var(--mw)) 405px;
  grid-template-rows: auto 1fr; grid-template-areas: "media head" "media body"; max-width: calc(var(--mw) + 407px); min-height: 450px; margin: 0 auto;
  border: 1px solid var(--ig-line); border-radius: 4px; background: var(--ig-bg); overflow: hidden; }
.ig-detail-head { grid-area: head; min-width: 0; padding: 14px 8px 14px 16px; border-left: 1px solid var(--ig-line); border-bottom: 1px solid var(--ig-line); }
.ig-detail-head .ig-post-head { padding: 0; }
.ig-detail-media { grid-area: media; display: flex; align-items: center; justify-content: center; min-width: 0; background: #000; }
.ig-detail-media .ig-post-media { width: 100%; border: 0; border-radius: 0; background: #000; }
.ig-detail-media .ig-post-media.ig-textcard { background: var(--ig-grad); }
.ig-detail-body { grid-area: body; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--ig-line); }
.ig-detail-comments { position: relative; flex: 1 1 auto; min-height: 120px; }
.ig-detail-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 16px; }
.ig-detail-body .ig-actions { margin: 0; padding: 4px 8px; border-top: 1px solid var(--ig-line); }
.ig-detail-body .ig-likes { margin: 0 0 4px; padding: 0 16px; }
.ig-detail-time { display: block; padding: 0 16px 14px; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-detail-form { padding: 10px 16px; min-height: 53px; border-top: 1px solid var(--ig-line); gap: 12px; }
.ig-no-comments { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 100%; text-align: center; }
.ig-no-comments h3 { font-size: 24px; line-height: 30px; font-weight: 700; }

.ig-comments { display: flex; flex-direction: column; gap: 16px; }
.ig-comment-caption { margin-bottom: 16px; }
.ig-comment { position: relative; display: flex; align-items: flex-start; gap: 14px; }
.ig-comment-av { display: inline-flex; flex: none; border-radius: 50%; }
.ig-comment-main { flex: 1; min-width: 0; padding-top: 7px; }
.ig-comment.is-reply .ig-comment-main { padding-top: 3px; }
.ig-comment-text { overflow-wrap: anywhere; }
.ig-comment-text .ig-u { margin-right: 2px; }
.ig-comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 6px; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-clikes { font-weight: 600; }
.ig-cmore { display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ig-text-2); opacity: 0; cursor: pointer; }
.ig-comment:hover > .ig-comment-main > .ig-comment-meta .ig-cmore, .ig-cmore:focus-visible { opacity: 1; }
.ig-clike { flex: none; margin: 10px 0 0; }
.ig-clike-btn { display: grid; place-items: center; padding: 2px; border: 0; background: none; color: var(--ig-text); cursor: pointer; }
.ig-clike-btn:hover { color: var(--ig-text-2); }
.ig-clike-btn.is-on { color: var(--ig-red); }
.ig-replies-toggle { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 0; border: 0; background: none; color: var(--ig-text-2);
  font-size: 12px; font-weight: 600; cursor: pointer; }
.ig-replies-line { width: 24px; height: 1px; background: var(--ig-text-2); }
.ig-replies { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }

.ig-more-from { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--ig-line); max-width: 935px; margin-left: auto; margin-right: auto; }
.ig-more-from h2 { color: var(--ig-text-2); font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.ig-more-from h2 a { color: var(--ig-text); }

/* ---------- Grids + tiles ---------- */
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ig-tile { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--ig-line-2); }
.ig-tile img, .ig-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ig-tile video { opacity: 0; transition: opacity .25s; }
.ig-tile video.is-playing { opacity: 1; }
.ig-tile-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: var(--ig-grad); color: #fff; font-weight: 600; text-align: center; }
.ig-tile-badge { position: absolute; top: 8px; right: 8px; z-index: 1; color: #fff; filter: drop-shadow(0 0 3px rgba(0,0,0,.45)); }
.ig-tile-views { position: absolute; left: 8px; bottom: 8px; z-index: 1; display: flex; align-items: center; gap: 4px; color: #fff; font-weight: 600;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.5)); }
.ig-tile-over { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 28px; background: rgba(0,0,0,.3);
  color: #fff; font-size: 16px; font-weight: 700; opacity: 0; transition: opacity .15s; }
.ig-tile-over span { display: flex; align-items: center; gap: 7px; }
.ig-tile:hover .ig-tile-over, .ig-tile:focus-visible .ig-tile-over { opacity: 1; }
.ig-grid.is-reels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ig-grid.is-reels .ig-tile { aspect-ratio: 9 / 16; }

/* Explore */
.ig-explore-page { max-width: 975px; margin: 0 auto; padding: 24px 20px 48px; }
.ig-explore { display: flex; flex-direction: column; gap: 4px; }
.ig-xblock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 4px; aspect-ratio: 3 / 2; }
.ig-xblock .ig-tile { aspect-ratio: auto; width: 100%; height: 100%; }
.ig-xblock .ig-tile-tall { grid-column: 3; grid-row: 1 / span 2; }
.ig-xblock.is-left .ig-tile-tall { grid-column: 1; }
.ig-search-form.ig-explore-search { display: none; }

/* ---------- Profile ---------- */
.ig-profile { max-width: 935px; margin: 0 auto; padding: 30px 20px 48px; }
.ig-prof-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-areas: "av top" "av stats" "av bio";
  column-gap: 30px; align-items: start; margin-bottom: 44px; }
.ig-prof-av { grid-area: av; display: flex; justify-content: center; }
.ig-prof-av a { display: inline-flex; border-radius: 50%; }
.ig-prof-top { grid-area: top; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; min-width: 0; }
.ig-prof-user { display: flex; align-items: center; margin-right: 12px; font-size: 20px; line-height: 25px; font-weight: 400; overflow-wrap: anywhere; }
.ig-prof-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ig-prof-actions .ig-btn .ig-i { margin-right: -4px; }
.ig-prof-gear { width: 32px; height: 32px; }
.ig-prof-stats { grid-area: stats; display: flex; gap: 40px; margin-bottom: 20px; font-size: 16px; line-height: 20px; }
.ig-prof-stats a:hover { opacity: .7; }
.ig-stat-m { display: none; }
.ig-prof-n { font-weight: 600; }
.ig-prof-bio { grid-area: bio; min-width: 0; }
.ig-prof-name { font-weight: 600; }
.ig-prof-cat { color: var(--ig-text-2); }
.ig-prof-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ig-link); font-weight: 600; }
.ig-prof-link:hover { text-decoration: underline; }
.ig-prof-fb { display: block; margin-top: 12px; color: var(--ig-text-2); font-size: 12px; line-height: 16px; font-weight: 600; }
.ig-highlights { display: flex; gap: 12px; padding: 0 0 44px 44px; overflow-x: auto; scrollbar-width: none; }
.ig-hl { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 115px; flex: none; padding: 0; border: 0; background: none; cursor: pointer; }
.ig-hl-ring { display: grid; place-items: center; width: 87px; height: 87px; padding: 3px; border: 1px solid var(--ig-line); border-radius: 50%; }
.ig-hl-new { display: grid; place-items: center; width: 77px; height: 77px; border-radius: 50%; background: var(--ig-soft); color: #c7c7c7; }
.ig-hl-name { font-size: 12px; font-weight: 600; }
.ig-tabs { display: flex; justify-content: center; gap: 60px; border-top: 1px solid var(--ig-line); }
.ig-tab { display: flex; align-items: center; gap: 6px; height: 52px; margin-top: -1px; border-top: 1px solid transparent; color: var(--ig-text-2);
  font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.ig-tab:hover { color: var(--ig-text); }
.ig-tab.is-active { color: var(--ig-text); border-top-color: var(--ig-text); }
.ig-saved-note { color: var(--ig-text-2); font-size: 12px; margin: 4px 0 16px; }
.ig-private { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; border-top: 1px solid var(--ig-line); text-align: center; }
.ig-private h2 { font-size: 14px; font-weight: 600; }
.ig-private p { color: var(--ig-text-2); }

/* Tag page */
.ig-tag-head { display: flex; align-items: center; gap: 48px; margin: 12px 0 44px 44px; }
.ig-tag-cover { display: grid; place-items: center; width: 152px; height: 152px; flex: none; overflow: hidden; border-radius: 50%; background: var(--ig-line-2); font-size: 56px; color: var(--ig-text-2); }
.ig-tag-cover img { width: 100%; height: 100%; object-fit: cover; }
.ig-tag-head h1 { font-size: 28px; line-height: 32px; font-weight: 400; margin-bottom: 12px; }
.ig-tag-head p { font-size: 16px; }

/* ---------- Generic pages, lists, people ---------- */
.ig-page { max-width: 600px; margin: 0 auto; padding: 32px 20px 48px; }
.ig-page-wide { max-width: 935px; }
.ig-h1 { font-size: 24px; line-height: 30px; font-weight: 700; margin: 0 0 20px; }
.ig-h2 { font-size: 16px; line-height: 20px; font-weight: 600; margin: 24px 0 8px; }
.ig-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; scrollbar-width: none; }
.ig-chips::-webkit-scrollbar { display: none; }
.ig-chip { flex: none; padding: 7px 14px; border: 1px solid var(--ig-line); border-radius: 18px; font-weight: 600; background: var(--ig-bg); }
.ig-chip:hover { background: var(--ig-soft); }
.ig-chip.is-active { background: var(--ig-text); border-color: var(--ig-text); color: var(--ig-on-text); }
.ig-list { display: flex; flex-direction: column; }
.ig-user-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; }
a.ig-user-row:hover .ig-u { color: var(--ig-text-2); }
.ig-user-row-av { display: inline-flex; flex: none; border-radius: 50%; }
.ig-user-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ig-user-row-main .ig-u { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-user-row-main > .ig-verified { display: none; }
.ig-user-row-sub { color: var(--ig-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-user-row-act { display: flex; gap: 8px; flex: none; }
.ig-user-row-act form { margin: 0; }
.ig-tag-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--ig-line); border-radius: 50%; font-size: 18px; }
.ig-search-form { display: flex; align-items: center; gap: 10px; height: 40px; margin: 0 0 16px; padding: 0 16px; border-radius: 8px; background: var(--ig-btn); color: var(--ig-text-2); }
.ig-search-form input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ig-text); font-size: 16px; }
.ig-search-form input::placeholder { color: var(--ig-text-2); }
.ig-search-form input::-webkit-search-cancel-button { display: none; }
.ig-search-clear { display: grid; place-items: center; padding: 0; border: 0; background: none; color: #c7c7c7; cursor: pointer; }
.ig-search-clear[hidden] { display: none; }
.ig-grid-search { margin-top: 8px; }
.ig-card { border: 1px solid var(--ig-line); border-radius: 12px; overflow: hidden; background: var(--ig-bg); }
.ig-card-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; min-height: 48px; padding: 0 4px; border-bottom: 1px solid var(--ig-line); }
.ig-card-head h1 { text-align: center; font-size: 16px; font-weight: 600; }
.ig-tabs-fill { gap: 0; border-top: 0; border-bottom: 1px solid var(--ig-line); }
.ig-tabs-fill .ig-tab { flex: 1; justify-content: center; margin: 0 0 -1px; border-top: 0; border-bottom: 1px solid transparent; text-transform: none; letter-spacing: 0; font-size: 14px; }
.ig-tabs-fill .ig-tab.is-active { border-bottom-color: var(--ig-text); }
.ig-card .ig-list { padding: 4px 16px 12px; max-height: 70vh; overflow-y: auto; }
.ig-search-inline { margin: 12px 16px 4px; }
.ig-card .ig-empty h3 { font-size: 20px; line-height: 25px; }
.ig-saved-head { margin-bottom: 12px; }
.ig-saved-back { display: inline-flex; align-items: center; gap: 4px; color: var(--ig-text-2); font-weight: 600; margin-bottom: 12px; }
.ig-saved-back:hover { color: var(--ig-text); }
.ig-saved-head .ig-h1 { margin-bottom: 4px; }
.ig-saved-head .ig-muted { font-size: 12px; margin-bottom: 16px; }

/* Empty states + 404 */
.ig-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; text-align: center; }
.ig-empty-ic { display: grid; place-items: center; width: 62px; height: 62px; border: 2px solid var(--ig-text); border-radius: 50%; color: var(--ig-text); flex: none; }
.ig-empty h3 { font-size: 30px; line-height: 36px; font-weight: 800; margin-top: 12px; }
.ig-empty p { max-width: 360px; }
.ig-404 { max-width: 600px; margin: 0 auto; padding: 40px 20px; text-align: center; }
.ig-404 h1 { font-size: 24px; line-height: 30px; font-weight: 600; margin-bottom: 20px; }
.ig-404 p { font-size: 16px; line-height: 20px; }
.ig-404 a { color: var(--ig-link); }

/* ---------- Notifications ---------- */
.ig-notif-sec { padding: 4px 0 12px; border-bottom: 1px solid var(--ig-line); }
.ig-notif-sec:last-child { border-bottom: 0; }
.ig-notif-sec h2 { font-size: 16px; line-height: 20px; font-weight: 700; margin: 16px 0 8px; }
.ig-notif { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; }
.ig-notif-av { display: inline-flex; flex: none; border-radius: 50%; }
.ig-notif-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ig-notif-text strong { font-weight: 600; }
.ig-notif-time { color: var(--ig-text-2); white-space: nowrap; }
.ig-notif-thumb { flex: none; }
.ig-notif-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.ig-notif-side { display: flex; gap: 8px; flex: none; }
.ig-notif-side form { margin: 0; }
.ig-notif-req { border-bottom: 1px solid var(--ig-line); padding-bottom: 16px; margin-bottom: 4px; }
.ig-notif-req .ig-notif-text { display: flex; flex-direction: column; }
.ig-req-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ig-blue); flex: none; }

/* ---------- Reels ---------- */
body.ig-l-reels { overflow: hidden; }
.ig-reels-title { display: none; }
.ig-reels { height: 100vh; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.ig-reels::-webkit-scrollbar { display: none; }
.ig-reel { display: flex; align-items: center; justify-content: center; height: 100vh; padding: 16px 0; scroll-snap-align: start; scroll-snap-stop: always; }
.ig-reel-stage { position: relative; display: flex; align-items: flex-end; gap: 16px; height: 100%; }
.ig-reel-video { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - var(--ig-side-w) - 110px); overflow: hidden; border-radius: 4px; background: #000; }
.ig-reel-video .ig-media { position: absolute; inset: 0; width: 100%; height: 100% !important; }
.ig-reel-mute { top: 16px; right: 16px; bottom: auto; }
.ig-reel-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 72px 16px 16px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none; }
.ig-reel-info a, .ig-reel-info button { pointer-events: auto; }
.ig-reel-user { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; overflow: hidden; white-space: nowrap; }
.ig-reel-user .ig-u { min-width: 0; }
.ig-reel-user .ig-follow-form, .ig-reel-user > a { flex: none; }
.ig-reel-user .ig-u { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-reel-user .ig-dot { color: #fff; margin: 0; }
.ig-reel-follow { height: 28px; padding: 0 10px; border: 1px solid rgba(255,255,255,.75); border-radius: 8px; background: transparent; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.ig-reel-follow:hover { background: rgba(255,255,255,.15); }
.ig-reel-cap { margin-bottom: 10px; overflow-wrap: anywhere; }
.ig-reel-cap .ig-hash { color: #fff; font-weight: 600; }
.ig-reel-cap .ig-more-btn { color: rgba(255,255,255,.75); }
.ig-reel-audio-line { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; }
.ig-reel-audio-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-reel-rail { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 6px; flex: none; }
.ig-reel-act { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ig-reel-act form { margin: 0; }
.ig-reel-n { font-size: 12px; line-height: 16px; }
.ig-reel-audio { display: block; width: 26px; height: 26px; margin-top: 4px; overflow: hidden; border: 1px solid var(--ig-line); border-radius: 6px; }
.ig-reel-audio .ig-av { width: 24px !important; height: 24px !important; border-radius: 4px; }
.ig-reels .ig-more { height: 120px; scroll-snap-align: end; align-items: center; }
.ig-reel-empty { padding-top: 15vh; }

/* ---------- Story viewer ---------- */
body.ig-l-bare { background: #1a1a1a; overflow: hidden; }
.ig-sv { position: fixed; inset: 0; z-index: 50; background: #1a1a1a; color: #fff; --ig-ring-gap: #1a1a1a; }
.ig-sv-logo { position: absolute; top: 20px; left: 20px; z-index: 5; }
.ig-sv-logo .ig-wordmark { color: #fff; font-size: 28px; }
.ig-sv-close { position: absolute; top: 12px; right: 12px; z-index: 5; display: grid; place-items: center; width: 44px; height: 44px; color: #fff; }
.ig-sv-track { display: flex; align-items: center; justify-content: center; gap: 56px; height: 100%; }
.ig-sv-stage { position: relative; height: calc(100vh - 32px); max-height: 100vh; aspect-ratio: 9 / 16; flex: none; border-radius: 8px; background: #000; }
.ig-sv-stage::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 110px; z-index: 2; border-radius: 8px 8px 0 0;
  background: linear-gradient(rgba(0,0,0,.4), transparent); pointer-events: none; }
.ig-sv-media { position: absolute; inset: 0; overflow: hidden; border-radius: 8px; background: #000; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ig-sv-media img, .ig-sv-media video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ig-sv-bars { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3; display: flex; gap: 4px; }
.ig-sv-bar { flex: 1; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.35); }
.ig-sv-bar i { display: block; width: 0; height: 100%; background: #fff; }
.ig-sv-head { position: absolute; top: 20px; left: 16px; right: 12px; z-index: 3; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ig-sv-user { display: flex; align-items: center; gap: 8px; min-width: 0; color: #fff; font-weight: 600; }
.ig-sv-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-sv-user img { width: 32px; height: 32px; flex: none; }
.ig-sv-ago { color: rgba(255,255,255,.7); white-space: nowrap; }
.ig-sv-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ig-sv-tool { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; }
.ig-sv-x { display: none; }
.ig-sv-play-ic { display: none; }
.ig-sv.is-paused .ig-sv-play-ic { display: block; }
.ig-sv.is-paused .ig-sv-pause-ic { display: none; }
.ig-sv.is-unmuted .ig-mute-off { display: none; }
.ig-sv.is-unmuted .ig-mute-on { display: block; }
.ig-sv-caption { position: absolute; left: 16px; right: 16px; bottom: 96px; z-index: 3; text-align: center; pointer-events: none; }
.ig-sv-caption span { display: inline-block; padding: 6px 12px; border-radius: 8px; background: rgba(0,0,0,.55); font-size: 20px; line-height: 26px; font-weight: 600; }
.ig-sv-nav { position: absolute; top: 50%; z-index: 4; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -15px; padding: 0; border: 0;
  border-radius: 50%; background: rgba(255,255,255,.9); color: #262626; cursor: pointer; }
.ig-sv-nav.is-prev { left: -42px; }
.ig-sv-nav.is-next { right: -42px; }
.ig-sv-nav[hidden] { display: none; }
.ig-sv-reply { position: absolute; left: 16px; right: 12px; bottom: 16px; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 0; }
.ig-sv-reply input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 1px solid rgba(255,255,255,.7); border-radius: 22px; outline: 0;
  background: transparent; color: #fff; font-size: 14px; }
.ig-sv-reply input::placeholder { color: rgba(255,255,255,.85); }
.ig-sv-own { position: absolute; left: 16px; right: 16px; bottom: 20px; z-index: 3; text-align: center; font-size: 12px; color: rgba(255,255,255,.85); }
.ig-sv-own span { display: inline-flex; align-items: center; gap: 6px; }
.ig-sv-side { display: flex; align-items: center; gap: 24px; width: 420px; flex: none; }
.ig-sv-side.is-left { justify-content: flex-end; }
.ig-sv-peek { position: relative; display: block; width: 190px; aspect-ratio: 9 / 16; flex: none; overflow: hidden; padding: 0; border: 0; border-radius: 8px;
  background: #000; color: #fff; cursor: pointer; }
.ig-sv-peek img.ig-sv-peek-bg { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.ig-sv-peek-who { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.ig-sv-peek-who b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ig-sv-peek-who small { color: rgba(255,255,255,.8); }
.ig-sv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.ig-sv-empty .ig-empty-ic { border-color: #fff; color: #fff; }
.ig-sv-empty h1 { font-size: 22px; font-weight: 600; }
.ig-sv-empty p { color: rgba(255,255,255,.75); }

/* ---------- Create ---------- */
.ig-create-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px 56px; background: rgba(0,0,0,.65); }
.ig-create-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 40px; height: 40px; color: #fff; }
.ig-create { display: flex; flex-direction: column; width: min(750px, 100%); margin: 0; overflow: hidden; border-radius: 12px; background: var(--ig-bg); transition: width .2s ease; }
.ig-create[data-step="edit"] { width: min(1090px, 100%); }
.ig-create-head { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; height: 43px; padding: 0 8px; border-bottom: 1px solid var(--ig-line); }
.ig-create-head h1 { grid-column: 2; grid-row: 1; text-align: center; font-size: 16px; font-weight: 600; }
.ig-create-back, .ig-create-x { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--ig-text); cursor: pointer; }
.ig-create-x { display: none; }
.ig-create-share { grid-column: 3; grid-row: 1; justify-self: end; padding: 8px; border: 0; background: none; color: var(--ig-blue); font-weight: 600; cursor: pointer; }
.ig-create-share:hover { color: var(--ig-link); }
.ig-create[data-step="pick"] .ig-create-back, .ig-create[data-step="done"] .ig-create-back,
.ig-create[data-step="pick"] .ig-create-share, .ig-create[data-step="done"] .ig-create-share { visibility: hidden; }
.ig-create-body { position: relative; height: min(750px, calc(100vh - 110px)); min-height: 360px; }
.ig-create-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; height: 100%; padding: 24px; text-align: center; transition: background .15s; }
.ig-create-pick.is-drag { background: var(--ig-soft); }
.ig-create-pick label { position: relative; }
.ig-create-art { width: 96px; height: 80px; color: var(--ig-text); }
.ig-create-art-front { fill: var(--ig-bg); }
.ig-create-lead { font-size: 20px; line-height: 25px; }
.ig-create-edit, .ig-create-done { display: none; height: 100%; }
.ig-create[data-step="edit"] .ig-create-pick, .ig-create[data-step="done"] .ig-create-pick { display: none; }
.ig-create[data-step="edit"] .ig-create-edit { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.ig-create[data-step="done"] .ig-create-done { display: flex; }
.ig-create-media { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; background: #000; }
.ig-create-media .st-preview-media { width: 100%; height: 100%; max-height: none; object-fit: contain; border-radius: 0; margin: 0; }
.ig-create-side { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-left: 1px solid var(--ig-line); }
.ig-create-who { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px; }
.ig-create-caption { min-height: 168px; padding: 0 16px; border: 0; outline: 0; resize: none; font-size: 16px; line-height: 24px; }
.ig-create-caption::placeholder { color: var(--ig-text-3); }
.ig-create-meta { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 12px 12px; color: #c7c7c7; font-size: 12px; border-bottom: 1px solid var(--ig-line); }
.ig-create-meta .ig-emoji-btn { color: var(--ig-text-2); }
.ig-create-meta .ig-emoji-panel { left: -8px; right: auto; top: calc(100% + 8px); bottom: auto; }
.ig-create-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ig-line); font-size: 16px; line-height: 20px; }
.ig-create-row > span { display: flex; align-items: center; gap: 8px; }
.ig-create-row select { max-width: 55%; border: 0; background: none; font-size: 14px; font-weight: 600; cursor: pointer; }
.ig-create-hint { padding: 12px 16px; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-create-done { flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; text-align: center; }
.ig-create-done h2 { font-size: 20px; line-height: 25px; font-weight: 400; }
.ig-create-done p { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ig-create-check { display: grid; place-items: center; width: 96px; height: 96px; border: 3px solid transparent; border-radius: 50%;
  background: linear-gradient(var(--ig-bg), var(--ig-bg)) padding-box, var(--ig-grad) border-box; color: #d62976; }
.ig-create[data-step="done"] .ig-create-check { animation: ig-pop .6s ease; }

/* ---------- Messages ---------- */
.ig-dm { display: grid; grid-template-columns: 397px minmax(0, 1fr); height: 100vh; }
.ig-dm-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--ig-line); }
.ig-dm-list-head { display: flex; align-items: center; gap: 8px; padding: 36px 16px 12px 24px; }
.ig-dm-me { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; line-height: 25px; font-weight: 700; }
.ig-dm-home { display: none; }
.ig-dm-list-sub { padding: 14px 24px 10px; font-size: 16px; line-height: 20px; }
.ig-dm-list-sub strong { font-weight: 700; }
.ig-dm-rows { flex: 1; overflow-y: auto; }
.ig-dm-none { padding: 16px 24px; color: var(--ig-text-2); }
.ig-dm-row { display: flex; align-items: center; gap: 12px; padding: 8px 24px; }
.ig-dm-row:hover { background: var(--ig-soft); }
.ig-dm-row.is-active { background: var(--ig-line-2); }
.ig-dm-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ig-dm-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-dm-row-prev { display: flex; min-width: 0; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-dm-row-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-dm-row-time { flex: none; }
.ig-dm-sep { flex: none; margin: 0 4px; }
.ig-dm-row.is-unread .ig-dm-row-name { font-weight: 600; }
.ig-dm-row.is-unread .ig-dm-row-prev { color: var(--ig-text); font-weight: 600; }
.ig-dm-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ig-blue); }
.ig-dm-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ig-dm-head { display: flex; align-items: center; gap: 12px; height: 75px; flex: none; padding: 0 16px; border-bottom: 1px solid var(--ig-line); }
.ig-dm-back { display: none; }
.ig-dm-who { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.ig-dm-who > span { min-width: 0; }
.ig-dm-who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 20px; font-weight: 600; }
.ig-dm-who small { display: block; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-dm-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 16px; }
.ig-dm-intro { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 0 32px; text-align: center; }
.ig-dm-intro strong { margin-top: 12px; font-size: 20px; line-height: 25px; font-weight: 600; }
.ig-dm-intro .ig-btn { margin-top: 12px; }
.ig-dm-time { margin: 16px 0 8px; text-align: center; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-msg { display: flex; align-items: flex-end; gap: 8px; max-width: min(75%, 560px); margin-top: 2px; }
.ig-msg.is-first, .ig-msg.is-single { margin-top: 8px; }
.ig-msg.is-mine { align-self: flex-end; }
.ig-msg-av { width: 28px; flex: none; }
.ig-msg-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ig-msg.is-mine .ig-msg-col { align-items: flex-end; }
.ig-msg-name { margin: 0 12px 2px; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-bubble { max-width: 100%; padding: 7px 12px; border-radius: 22px; background: var(--ig-dm-them); font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.ig-msg.is-mine .ig-bubble { background: var(--ig-dm-me); color: #fff; }
.ig-msg.is-mine .ig-bubble a { color: #fff; text-decoration: underline; }
.ig-msg:not(.is-mine).is-first .ig-bubble { border-bottom-left-radius: 4px; }
.ig-msg:not(.is-mine).is-middle .ig-bubble { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.ig-msg:not(.is-mine).is-last .ig-bubble { border-top-left-radius: 4px; }
.ig-msg.is-mine.is-first .ig-bubble { border-bottom-right-radius: 4px; }
.ig-msg.is-mine.is-middle .ig-bubble { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.ig-msg.is-mine.is-last .ig-bubble { border-top-right-radius: 4px; }
.ig-bubble.is-emoji { padding: 0; background: none !important; font-size: 40px; line-height: 48px; }
.ig-msg-post { display: flex; flex-direction: column; width: 236px; overflow: hidden; border-radius: 16px; background: var(--ig-dm-them); color: var(--ig-text); }
.ig-msg-post-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.ig-msg-post img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ig-msg-post-cap { padding: 8px 12px 10px; font-size: 14px; line-height: 18px; }
.ig-dm-seen { align-self: flex-end; margin: 4px 4px 0; color: var(--ig-text-2); font-size: 12px; }
.ig-dm-compose { display: flex; align-items: center; gap: 10px; flex: none; min-height: 44px; margin: 12px 16px 16px; padding: 0 16px 0 11px; border: 1px solid var(--ig-line); border-radius: 22px; }
.ig-dm-input { flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; font-size: 15px; }
.ig-dm-send { flex: none; padding: 0; border: 0; background: none; color: var(--ig-blue); font-weight: 600; cursor: pointer; }
.ig-dm-send:hover { color: var(--ig-link); }
.ig-dm-heart { display: grid; place-items: center; flex: none; padding: 0; border: 0; background: none; cursor: pointer; }
.ig-dm-input:placeholder-shown ~ .ig-dm-send { display: none; }
.ig-dm-input:not(:placeholder-shown) ~ .ig-dm-heart { display: none; }
.ig-dm-blank { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: auto; padding: 24px; text-align: center; }
.ig-dm-blank-ic { display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 8px; border: 2px solid var(--ig-text); border-radius: 50%; }
.ig-dm-blank h2 { font-size: 20px; line-height: 25px; font-weight: 400; }
.ig-dm-blank p { color: var(--ig-text-2); }
.ig-dm-blank .ig-btn { margin-top: 8px; }

/* ---------- Dialogs: sheets + modals ---------- */
dialog.ig-sheet, dialog.ig-modal { max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 0; border: 0; background: transparent; overflow: visible; }
dialog.ig-sheet::backdrop, dialog.ig-modal::backdrop { background: rgba(0,0,0,.65); }
.ig-sheet-card { width: 400px; max-width: 100%; overflow: hidden; border-radius: 12px; background: var(--ig-bg); animation: ig-zoom .12s ease-out; }
@keyframes ig-zoom { from { transform: scale(1.12); opacity: 0; } to { transform: none; opacity: 1; } }
.ig-sheet-form { margin: 0; }
.ig-sheet-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 4px 8px; border: 0; border-top: 1px solid var(--ig-line);
  background: none; color: var(--ig-text); font-size: 14px; line-height: 18px; text-align: center; cursor: pointer; }
.ig-sheet-card > :first-child, .ig-sheet-card > :first-child .ig-sheet-btn { border-top: 0; }
.ig-sheet-btn:active { background: var(--ig-hover); }
.ig-sheet-btn.is-danger { color: var(--ig-err); font-weight: 700; }
.ig-confirm-msg { padding: 32px 32px 16px; text-align: center; }
.ig-confirm-msg h3 { font-size: 20px; line-height: 25px; font-weight: 400; }
.ig-confirm-msg p { margin-top: 4px; color: var(--ig-text-2); }
.ig-confirm-msg p:empty { display: none; }
.ig-confirm .ig-sheet-btn { border-top: 1px solid var(--ig-line) !important; }
.ig-modal-card { display: flex; flex-direction: column; width: 548px; max-width: 100%; max-height: min(680px, calc(100vh - 32px)); overflow: hidden; border-radius: 12px;
  background: var(--ig-bg); animation: ig-zoom .12s ease-out; }
.ig-modal-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; min-height: 44px; padding: 0 4px; border-bottom: 1px solid var(--ig-line); flex: none; }
.ig-modal-head h2 { text-align: center; font-size: 16px; font-weight: 700; }
.ig-share-to { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 4px 16px; border-bottom: 1px solid var(--ig-line); flex: none; }
.ig-share-to span { font-size: 16px; font-weight: 600; }
.ig-share-to input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; }
.ig-share-sub { padding: 14px 16px 6px; font-weight: 600; flex: none; }
.ig-share-list { flex: 1; min-height: 80px; overflow-y: auto; }
.ig-share-person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.ig-share-person:hover { background: var(--ig-soft); }
.ig-share-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ig-share-who strong, .ig-share-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-share-who strong { font-weight: 400; }
.ig-share-who small { color: var(--ig-text-2); font-size: 14px; }
.ig-check { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 2px solid #c7c7c7; border-radius: 50%; color: transparent; }
.ig-share-person[aria-pressed="true"] .ig-check { background: var(--ig-blue); border-color: var(--ig-blue); color: #fff; }
.ig-share-foot { padding: 12px 16px; border-top: 1px solid var(--ig-line); flex: none; }
.ig-share-copy { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--ig-line); background: none;
  font-weight: 600; text-align: left; cursor: pointer; flex: none; }
.ig-share-copy:hover { background: var(--ig-soft); }
.ig-share-copy-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ig-btn); }
.ig-story-new { width: 440px; }
.ig-story-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; margin: 0; }
.ig-story-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 16px; border: 1px dashed var(--ig-line); border-radius: 12px;
  text-align: center; cursor: pointer; }
.ig-story-pick:hover { background: var(--ig-soft); }
.ig-story-prev .st-preview-media { max-height: 46vh; border-radius: 8px; }
.ig-input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--ig-line); border-radius: 8px; outline: 0; background: var(--ig-soft); font-size: 14px; }
.ig-input:focus { border-color: var(--ig-text-3); }

/* ---------- Auth (login / sign up) ---------- */
body.ig-l-auth { background: var(--ig-bg); }
.ig-auth { display: flex; flex-direction: column; min-height: 100vh; }
.ig-auth-main { flex: 1; display: flex; align-items: center; justify-content: center; gap: 32px; padding: 32px 16px 0; }
.ig-auth-phones { position: relative; width: 380px; height: 581px; flex: none; }
.ig-phone { position: absolute; width: 250px; height: 520px; padding: 10px; border-radius: 40px; background: #111; box-shadow: 0 24px 48px rgba(0,0,0,.18), inset 0 0 0 2px #3a3a3c; }
.ig-phone.is-back { left: 0; top: 0; }
.ig-phone.is-front { right: 8px; top: 48px; }
.ig-phone-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 31px; background: var(--ig-bg); }
.ig-phone-screen::before { content: ""; position: absolute; top: 8px; left: 50%; z-index: 2; width: 72px; height: 20px; margin-left: -36px; border-radius: 12px; background: #111; }
.ig-mini-top { display: flex; align-items: center; justify-content: space-between; padding: 34px 12px 4px; }
.ig-mini-top .ig-wordmark { font-size: 20px; }
.ig-mini-top > span { display: flex; gap: 10px; }
.ig-mini-stories { display: flex; gap: 8px; padding: 6px 10px 8px; border-bottom: 1px solid var(--ig-line-2); }
.ig-mini-ring { display: inline-flex; padding: 2px; border-radius: 50%; background: var(--ig-grad); flex: none; }
.ig-mini-ring .ig-av { border: 2px solid var(--ig-bg); box-sizing: content-box; }
.ig-mini-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 10px; }
.ig-mini-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--ig-line-2); }
.ig-mini-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: ig-slide 16s infinite; }
@keyframes ig-slide { 0% { opacity: 0; } 3% { opacity: 1; } 25% { opacity: 1; } 28% { opacity: 0; } 100% { opacity: 0; } }
.ig-mini-actions { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; }
.ig-mini-actions span { flex: 1; }
.ig-mini-actions .ig-i:first-child { color: var(--ig-red); }
.ig-mini-lines { padding: 2px 10px; }
.ig-mini-lines i, .ig-mini-bio i, .ig-mini-stats i { display: block; height: 7px; margin: 5px 0; border-radius: 4px; background: var(--ig-line-2); }
.ig-mini-lines i:first-child { width: 42%; }
.ig-mini-lines i + i { width: 78%; }
.ig-mini-prof { display: flex; align-items: center; gap: 14px; padding: 40px 12px 8px; }
.ig-mini-stats { flex: 1; display: flex; gap: 8px; }
.ig-mini-stats i { flex: 1; height: 22px; }
.ig-mini-bio { padding: 0 12px 6px; }
.ig-mini-bio i:first-child { width: 50%; }
.ig-mini-bio i + i { width: 80%; }
.ig-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 8px; }
.ig-mini-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ig-auth-main-center { align-items: flex-start; }
.ig-auth-col { display: flex; flex-direction: column; gap: 10px; width: 350px; max-width: 100%; }
.ig-auth-card { padding: 10px 40px 20px; border: 1px solid var(--ig-line); background: var(--ig-bg); }
.ig-auth-logo { display: flex; justify-content: center; margin: 32px 0 24px; }
.ig-auth-logo .ig-wordmark { font-size: 42px; }
.ig-auth-lead { margin: -8px 0 20px; color: var(--ig-text-2); font-size: 17px; line-height: 20px; font-weight: 600; text-align: center; }
.ig-auth-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--ig-soft); color: var(--ig-text-2); text-align: center; }
.ig-auth-form { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ig-float { position: relative; display: block; height: 38px; border: 1px solid var(--ig-line); border-radius: 3px; background: var(--ig-soft); }
.ig-float:focus-within { border-color: var(--ig-text-3); }
.ig-float input { width: 100%; height: 100%; padding: 9px 8px 7px; border: 0; outline: 0; background: transparent; font-size: 12px; line-height: 18px; }
.ig-float label { position: absolute; left: 9px; top: 10px; color: var(--ig-text-2); font-size: 12px; line-height: 18px; pointer-events: none;
  transform-origin: left top; transition: transform .1s ease-out; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 18px); }
.ig-float:has(.ig-float-show) input:not(:placeholder-shown) + label { max-width: calc(100% - 60px); }
.ig-float input:not(:placeholder-shown) { padding: 14px 52px 2px 8px; }
.ig-loc-ro .ig-float:has(.ig-float-show) input:not(:placeholder-shown) { padding-right: 80px; }   /* "Afișează" / "Ascunde" */
.ig-float input:not(:placeholder-shown) + label { transform: scale(.8333) translateY(-10px); }
.ig-float-show { position: absolute; right: 8px; top: 50%; display: none; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; transform: translateY(-50%); cursor: pointer; }
.ig-float input:not(:placeholder-shown) ~ .ig-float-show { display: block; }
.ig-auth-submit { margin-top: 10px; }
.ig-auth-form:has(input[required]:placeholder-shown) .ig-auth-submit { opacity: .7; }
.ig-or { display: flex; align-items: center; gap: 18px; margin: 14px 0 20px; color: var(--ig-text-2); font-size: 13px; line-height: 15px; font-weight: 600; }
.ig-or::before, .ig-or::after { content: ""; flex: 1; height: 1px; background: var(--ig-line); }
.ig-auth-error { margin: 0 0 16px; color: var(--ig-err); text-align: center; }
.ig-auth-forgot { display: block; margin-bottom: 4px; text-align: center; color: var(--ig-link); font-size: 12px; }
.ig-auth-legal { margin: 6px 0; color: var(--ig-text-2); font-size: 12px; line-height: 16px; text-align: center; }
.ig-auth-switch { padding: 20px; text-align: center; }
.ig-auth-switch a { color: var(--ig-blue); font-weight: 600; }
.ig-demo { padding: 16px 24px; }
.ig-demo h2 { font-size: 16px; line-height: 20px; font-weight: 600; }
.ig-demo > .ig-muted { font-size: 12px; margin: 2px 0 8px; }
.ig-demo form { margin: 0; }
.ig-demo-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.ig-demo-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ig-demo-who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-demo-who small { color: var(--ig-text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-demo-go { color: var(--ig-blue); font-weight: 600; }
.ig-demo-row:hover .ig-demo-go { color: var(--ig-link); }
.ig-auth-foot { padding: 24px 16px 52px; text-align: center; color: var(--ig-text-2); }

/* ---------- Shared views (settings, dashboard, ads, promote …) ---------- */
.ig .avatar { border-radius: 50%; object-fit: cover; flex: none; }
.ig .st-stats > .st-card + .st-card, .ig .st-grid > .st-card + .st-card, .ig .st-grid-2 > .st-card + .st-card { margin-top: 0; }
.ig .st-chip svg { width: 16px; height: 16px; }
.ig .st-wrap { padding: 32px 20px 48px; }
.ig .st-card { border-color: var(--ig-line); border-radius: 12px; box-shadow: none; }
.ig .st-h1 { font-size: 24px; line-height: 30px; font-weight: 700; }
.ig .st-h2 { font-size: 16px; font-weight: 600; }
.ig .st-btn { height: 32px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--ig-btn); font-size: 14px; font-weight: 600; }
.ig .st-btn:hover { filter: none; background: var(--ig-btn-h); }
.ig .st-btn-primary { background: var(--ig-blue); color: #fff; }
.ig .st-btn-primary:hover { background: var(--ig-blue-h); }
.ig .st-btn-danger { background: transparent; border: 1px solid var(--ig-err); color: var(--ig-err); }
.ig .tk-hero-actions .st-btn:not(.st-btn-primary) { background: #efefef; } .ig .tk-hero-actions .st-btn:not(.st-btn-primary):hover { background: #dbdbdb; }   /* on the gold card, in both appearances */
.ig .st-input, .ig .st-textarea, .ig .st-select { border-radius: 12px; font-size: 14px; }
.ig .st-tab { border-bottom-width: 1px; font-weight: 600; }
.ig .st-tab.is-active { border-bottom-color: var(--ig-text); }
.ig .st-link { color: var(--ig-blue); }
.ig .st-toast { background: #262626; border-radius: 8px; font-size: 14px; }
.ig .st-toast-error { background: #262626; box-shadow: inset 4px 0 0 var(--ig-err), 0 8px 24px rgba(0,0,0,.25); }

/* ---------- Sponsored units (feed, reels, stories, explore) ---------- */
.ig-ad-hit { position: absolute; inset: 0; display: block; }
.ig-cta.is-lit, .ig-cta:focus-visible { background: var(--ig-blue); color: #fff; border-color: var(--ig-blue); }
.ig-cta .ig-i { flex: none; }
.ig-cta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-ad-empty { display: grid; place-items: center; }
/* Carousel: swipe (scroll-snap) with arrows, a counter and dots */
.ig-car .ig-car-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.ig-car .ig-car-track::-webkit-scrollbar { display: none; }
.ig-car-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.ig-car-btn { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.85); color: #262626; box-shadow: 0 0 5px rgba(0,0,0,.2); cursor: pointer; }
.ig-car-btn.is-prev { left: 8px; }
.ig-car-btn.is-next { right: 8px; }
.ig-car-btn[hidden] { display: none; }
.ig-car-count { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 3px 8px; border-radius: 12px; background: rgba(18,18,18,.7); color: #fff; font-size: 12px; font-weight: 600; }
.ig-car-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.ig-car-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.ig-car-dots i.is-on { background: #fff; }
/* "Ad hidden" — what ads/action.php sends back in place of a unit */
/* What replaces a unit after Hide ad / Report ad (themes/insta/ads/_hidden.php) */
[data-ad-hidden] { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 0 20px; padding: 32px 24px; border: 1px solid var(--ig-line); border-radius: 8px;
  background: var(--ig-bg); color: var(--ig-text-2); text-align: center; line-height: 18px; }
.ig-ad-gone-ic { display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--ig-text); border-radius: 50%; color: var(--ig-text); }
.ig-ad-gone p { max-width: 320px; margin: 0; }
.ig-reels [data-ad-hidden] { justify-content: center; height: 100vh; margin: 0; border: 0; border-radius: 0; background: #000; color: rgba(255,255,255,.8); scroll-snap-align: start; }
.ig-reels .ig-ad-gone-ic { border-color: #fff; color: #fff; }
/* The "···" sheet: a menu, then the question (hide / report reasons) or the reasons you see the ad */
.ig-sheet-title { padding: 20px 24px 12px; text-align: center; }
.ig-sheet-title h3 { font-size: 16px; line-height: 20px; font-weight: 700; outline: 0; }
.ig-ad-why h3 { outline: 0; }
.ig-sheet-title p { margin-top: 6px; color: var(--ig-text-2); font-size: 13px; line-height: 17px; }
.ig-sheet-title + .ig-sheet-form .ig-sheet-btn, .ig-sheet-title + .ig-sheet-btn { border-top: 1px solid var(--ig-line) !important; }
.ig-ad-why { padding-top: 20px; }
.ig-ad-why-who { display: flex; align-items: center; gap: 12px; padding: 0 24px 12px; }
.ig-ad-why-who strong { display: block; font-weight: 600; }
.ig-ad-why-who div span { color: var(--ig-text-2); font-size: 12px; }
.ig-ad-why h3 { padding: 8px 24px 0; font-size: 16px; font-weight: 700; }
.ig-ad-why ul { margin: 8px 0 0; padding: 0 24px 0 42px; list-style: disc; }
.ig-ad-why li { margin: 6px 0; line-height: 18px; }
.ig-ad-why p { padding: 10px 24px 16px; color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
/* Explore: a sponsored tile keeps its label */
.ig-ad-tag { position: absolute; left: 8px; bottom: 8px; z-index: 1; padding: 2px 8px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; }
/* Reels: "Sponsored" under the name, the CTA as a translucent bar */
.ig-reel-who { display: flex; flex-direction: column; min-width: 0; line-height: 16px; }
.ig-reel-name { display: flex; align-items: center; min-width: 0; }
.ig-reel-sponsored { font-size: 12px; opacity: .9; }
.ig-cta.is-reel { margin: 0 0 10px; padding: 9px 12px; border: 0; border-radius: 8px; background: rgba(255,255,255,.2); color: #fff; pointer-events: auto; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ig-cta.is-reel:hover, .ig-cta.is-reel.is-lit { background: var(--ig-blue); }
/* Stories: the CTA at the bottom */
.ig-sv-cta { position: absolute; left: 50%; bottom: 22px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 150px; max-width: 80%;
  padding: 8px 18px 9px; border-radius: 22px; background: #fff; color: #000; font-weight: 600; text-align: center; transform: translateX(-50%); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.ig-sv-cta[hidden] { display: none; }
.ig-sv-cta span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-sv.is-ad .ig-sv-ago { color: #fff; font-weight: 600; }
.ig-sv-av-ph { display: inline-grid; place-items: center; width: 32px; height: 32px; color: #fff; font-size: 13px; font-weight: 700; }
.ig-sv-av-ph[hidden] { display: none; }

/* ---------- Boost: under your own posts ---------- */
.ig-boost-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 2px; min-width: 0; }
.ig-boost-left { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.ig-boost-insights { color: var(--ig-blue); font-weight: 600; }
.ig-boost-insights:hover { color: var(--ig-link); }
.ig-boost-hint { color: var(--ig-text-2); font-size: 12px; }
.ig-boost-status { display: inline-flex; align-items: center; gap: 6px; color: var(--ig-text-2); font-size: 12px; font-weight: 600; }
.ig-boost-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ig-text-3); }
.ig-boost-status.is-green i { background: #31a24c; } .ig-boost-status.is-amber i { background: #f7b928; } .ig-boost-status.is-red i { background: var(--ig-err); } .ig-boost-status.is-blue i { background: var(--ig-blue); }
.ig-boost-bar .ig-btn { flex: none; }
.ig-boost-bar.is-detail { padding: 10px 16px; border-top: 1px solid var(--ig-line); }

/* ---------- Boost flow (ads/boost.php in the Instagram frame) ---------- */
.ig-boost { display: flex; justify-content: center; padding: 32px 20px 64px; }
.ig-boost-card { width: 100%; max-width: 560px; margin: 0; overflow: clip; border: 1px solid var(--ig-line); border-radius: 12px; background: var(--ig-bg); }   /* clip, not hidden: the sticky head / foot stick to the page */
.ig-boost-head { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; min-height: 52px; padding: 0 8px;
  border-bottom: 1px solid var(--ig-line); background: var(--ig-bg); }
.ig-boost-head h1 { text-align: center; font-size: 16px; line-height: 20px; font-weight: 700; }
.ig-boost-count { justify-self: end; padding-right: 8px; color: var(--ig-text-2); font-size: 12px; font-weight: 600; }
.ig-boost-step { padding: 20px 20px 8px; }
.ig-boost-step + .ig-boost-step { border-top: 1px solid var(--ig-line); }
.ig-boost.is-steps .ig-boost-step { display: none; border-top: 0; }
.ig-boost.is-steps .ig-boost-step.is-current { display: block; }
.ig-boost.is-steps .ig-boost-done.is-current { display: flex; }
.ig-boost-step h2 { margin-bottom: 12px; font-size: 20px; line-height: 25px; font-weight: 700; outline: 0; }
.ig-boost-options { display: flex; flex-direction: column; }
.ig-boost-option { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--ig-line-2); cursor: pointer; }
.ig-boost-option-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ig-boost-option-text strong { font-size: 15px; font-weight: 600; }
.ig-boost-option-text small { color: var(--ig-text-2); font-size: 13px; line-height: 17px; }
.ig-boost-option input, .ig-boost-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ig-radio { flex: none; width: 24px; height: 24px; border: 2px solid var(--ig-text-3); border-radius: 50%; transition: border-width .12s; }
.ig-boost-option input:checked + .ig-radio { border: 7px solid var(--ig-blue); }
.ig-boost-option input:focus-visible + .ig-radio, .ig-boost-chip input:focus-visible + span { outline: 2px solid var(--ig-blue); outline-offset: 2px; }
.ig-boost-option.is-disabled { opacity: .5; cursor: default; }
.ig-boost-site, .ig-boost-custom { display: flex; flex-direction: column; gap: 14px; padding: 16px 0 4px; }
.ig-boost-site[hidden], .ig-boost-custom[hidden] { display: none; }
.ig-boost-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ig-boost-field > span { font-weight: 600; }
.ig-boost-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ig-boost-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ig-boost-chips.is-scroll { max-height: 152px; overflow-y: auto; padding: 2px; }
.ig-boost-chip { position: relative; }
.ig-boost-chip[hidden] { display: none; }
.ig-boost-chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--ig-line); border-radius: 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ig-boost-chip input:checked + span { border-color: var(--ig-text); background: var(--ig-text); color: var(--ig-on-text); }
.ig-boost-help { color: var(--ig-text-2); font-size: 12px; }
.ig-boost-total { margin: 0 0 18px; font-size: 24px; line-height: 30px; font-weight: 700; }
.ig-boost-slider { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ig-boost-slider-head { display: flex; justify-content: space-between; gap: 12px; }
/* Instagram's slider: a thin grey track, blue up to the value (--p, set by insta.js), a white knob */
.ig-boost-slider input[type=range] { --p: 50%; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.ig-boost-slider input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ig-blue) var(--p), var(--ig-line) var(--p)); }
.ig-boost-slider input[type=range]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3), 0 0 0 .5px rgba(0,0,0,.08); -webkit-appearance: none; appearance: none; }
.ig-boost-slider input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--ig-line); }
.ig-boost-slider input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ig-blue); }
.ig-boost-slider input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ig-boost-slider input[type=range]:focus { outline: 0; }
.ig-boost-slider input[type=range]:focus-visible { outline: 2px solid var(--ig-blue); outline-offset: 4px; border-radius: 4px; }
.ig-boost-estimate { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; padding: 14px 16px; border-radius: 12px; background: var(--ig-soft); }
.ig-boost-estimate span, .ig-boost-estimate small { color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-boost-estimate strong { font-size: 16px; line-height: 20px; }
.ig-boost-preview-wrap { max-width: 400px; margin: 0 auto 16px; }
.ig-boost-preview { margin: 0; padding-bottom: 8px; border-bottom: 0; }
.ig-boost-summary { margin: 0 0 12px; }
.ig-boost-summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--ig-line-2); }
.ig-boost-summary dt { color: var(--ig-text-2); }
.ig-boost-summary dd { margin: 0; font-weight: 600; text-align: right; }
.ig-boost-summary dd small { display: block; color: var(--ig-warn); font-size: 12px; font-weight: 400; }
.ig-boost-legal { color: var(--ig-text-2); font-size: 12px; line-height: 16px; }
.ig-boost-errors { margin: 12px 20px 0; padding: 10px 12px; border-radius: 8px; background: var(--ig-err-bg); color: var(--ig-err); }
.ig-boost-errors[hidden] { display: none; }
.ig-boost-foot { padding: 12px 20px 20px; }
.ig-boost-foot .ig-btn { height: 44px; }
.ig-boost-foot .ig-btn[hidden] { display: none; }
.ig-boost-done { flex-direction: column; align-items: center; gap: 12px; padding: 40px 24px; text-align: center; }
.ig-boost-done h2 { margin: 8px 0 0; }
.ig-boost-done p { color: var(--ig-text-2); }
.ig-boost-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---------- Account menu rows (More menu, "Settings and activity") ---------- */
.ig-menu-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.ig-menu-text small { color: var(--ig-text-2); font-size: 12px; line-height: 15px; }
.ig-me-sheet .ig-menu-row { justify-content: flex-start; gap: 14px; padding: 10px 20px; font-size: 15px; }
.ig-me-sheet .ig-sheet-title { padding-bottom: 14px; }

/* Demo style switcher: sits in the sidebar above "More" on desktop (out of the way while the More menu is open) */
body:has(.ig-more-menu:not([hidden])) .st-preview { visibility: hidden; }
@media (min-width: 768px) {
  body.ig:not(.ig-l-auth):not(.ig-l-bare) .st-preview { left: 12px; bottom: 84px; }
}
@media (min-width: 768px) and (max-width: 1263px) {
  body.ig:not(.ig-l-auth):not(.ig-l-bare) .st-preview { left: 19px; }
  body.ig:not(.ig-l-auth):not(.ig-l-bare) .st-preview summary { font-size: 0; gap: 0; width: 34px; height: 34px; padding: 0; justify-content: center; }
  body.ig:not(.ig-l-auth):not(.ig-l-bare) .st-preview summary .st-preview-dot { width: 12px; height: 12px; }
}
@media (min-width: 768px) {
  body.ig-p-messages { --ig-side-w: 72px; }
  body.ig-p-messages .st-preview { left: 19px; }
  body.ig-p-messages .st-preview summary { font-size: 0; gap: 0; width: 34px; height: 34px; padding: 0; justify-content: center; }
  body.ig-p-messages .st-preview summary .st-preview-dot { width: 12px; height: 12px; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1263px) {
  :root { --ig-side-w: 72px; }
  .ig-more-menu { left: 0; }
}
@media (max-width: 1159px) {
  .ig-rail { display: none; }
  .ig-dm { grid-template-columns: 340px minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .ig-sv-side { display: none; }
  .ig-detail { grid-template-columns: minmax(0, var(--mw)) 335px; max-width: calc(var(--mw) + 337px); }
  .ig-create[data-step="edit"] .ig-create-edit { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  .ig-dm { grid-template-columns: 300px minmax(0, 1fr); }
  .ig-auth-phones { display: none; }
}
@media (min-width: 1001px) and (max-width: 1399px) {
  .ig-sv-side { width: 190px; }
  .ig-sv-side .ig-sv-peek:nth-child(n+2) { display: none; }
}
@media (hover: none) {
  .ig-stories-arrow { display: none !important; }
  .ig-tile-over { display: none; }
  .ig-cmore { opacity: 1; }
  .ig-add-comment:not(.ig-detail-form) .ig-emoji { display: none; }
}

/* Phones: top bar + bottom tab bar, full-bleed posts */
@media (max-width: 767px) {
  :root { --ig-side-w: 0px; --st-preview-bottom: calc(var(--ig-tab-h) + 12px + env(safe-area-inset-bottom, 0px)); }
  body.ig:not(.ig-l-auth):not(.ig-l-bare) { padding-bottom: calc(var(--ig-tab-h) + env(safe-area-inset-bottom, 0px)); }
  .ig-side { display: none; }
  .ig-shell { min-height: 0; }

  .ig-mtop { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; height: 44px;
    padding: 0 4px; background: var(--ig-bg); border-bottom: 1px solid var(--ig-line); }
  .ig-mtop-title { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
  .ig-mtop-side { display: flex; align-items: center; }
  .ig-mtop-side-r { justify-content: flex-end; }
  .ig-mtop-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ig-text); cursor: pointer; }
  .ig-mtop-home { display: flex; justify-content: space-between; height: var(--ig-mtop-h); padding: 0 8px 0 16px; border-bottom: 0; }
  .ig-mtop-home .ig-wordmark { font-size: 28px; }
  .ig-mtop-actions { display: flex; align-items: center; }
  .ig-mtop-actions .ig-badge { top: 4px; right: 2px; }
  .ig-mtop-actions .ig-dot-badge { top: 9px; right: 9px; }

  .ig-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-around;
    height: calc(var(--ig-tab-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--ig-bg); border-top: 1px solid var(--ig-line); }
  .ig-tab-item { flex: 1; display: grid; place-items: center; height: var(--ig-tab-h); color: var(--ig-text); }

  .ig-h1 { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .ig-page, .ig-profile, .ig-explore-page, .ig-detail-page, .ig .st-wrap { padding-top: 12px; }
  .ig .st-wrap > .st-h1:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ig-page { padding-left: 16px; padding-right: 16px; }

  /* Home */
  .ig-home { display: block; padding: 0; }
  .ig-home-col { max-width: none; }
  .ig-stories { border-bottom: 1px solid var(--ig-line-2); }
  .ig-stories-list { gap: 4px; padding: 10px 8px; }
  .ig-feed { max-width: none; margin: 0; }
  .ig-post { margin-bottom: 14px; padding-bottom: 6px; border-bottom: 0; }
  .ig-post-head { padding: 8px 8px 8px 12px; }
  .ig-post-media { border: 0; border-radius: 0; }
  .ig-post-body { padding: 0 14px; }
  .ig-cta { border-left: 0; border-right: 0; border-radius: 0; }
  .ig-caught-up { padding: 24px 16px 40px; }

  /* Detail */
  .ig-detail-page { padding: 0 0 16px; }
  .ig-detail { display: flex; flex-direction: column; max-width: none; min-height: 0; border: 0; border-radius: 0; }
  .ig-detail-head { order: 1; padding: 8px 8px 8px 12px; border: 0; }
  .ig-detail-media { order: 2; }
  .ig-detail-body { order: 3; border: 0; }
  .ig-detail-body .ig-actions { order: 1; padding: 2px 6px; border: 0; }
  .ig-detail-body .ig-likes { order: 2; padding: 0 14px; }
  .ig-detail-comments { order: 3; min-height: 0; }
  .ig-detail-scroll { position: static; padding: 4px 14px 8px; }
  .ig-detail-time { order: 4; padding: 0 14px 12px; }
  .ig-detail-form { order: 5; padding: 10px 14px; }
  .ig-no-comments { padding: 24px 0; }
  .ig-more-from { margin: 24px 0 0; padding: 20px 0 0; }
  .ig-more-from h2 { padding: 0 14px; }

  /* Grids */
  .ig-grid { gap: 2px; }
  .ig-grid.is-reels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ig-explore-page { padding: 0 0 24px; }
  .ig-search-form.ig-explore-search { display: flex; margin: 8px 12px; }
  .ig-explore-search, .ig-search-page > .ig-search-form { position: sticky; top: 8px; z-index: 6; box-shadow: 0 -8px 0 8px var(--ig-bg); }
  .ig-explore, .ig-xblock { gap: 2px; }

  /* Profile (classic mobile web layout) */
  .ig-profile { padding: 16px 0 24px; }
  .ig-prof-head { grid-template-columns: 77px minmax(0, 1fr); grid-template-areas: "av user" "av act" "bio bio" "stats stats"; column-gap: 28px; margin: 0 16px 20px; }
  .ig-prof-av { align-self: center; }
  .ig-prof-av .ig-av { width: 77px !important; height: 77px !important; font-size: 30px !important; }
  .ig-prof-top { display: contents; }
  .ig-prof-user { grid-area: user; align-self: end; margin: 0 0 8px; font-size: 20px; }
  .ig-prof-actions { grid-area: act; align-self: start; }
  .ig-prof-actions .ig-btn:not(.ig-btn-icon) { flex: 1; }
  /* Romanian labels ("Editează profilul", "Urmărești ⌄ · Trimite mesaj") don't fit beside the avatar:
     the buttons take a full-width row under the bio, like the app. */
  .ig-loc-ro .ig-prof-head { grid-template-areas: "av user" "bio bio" "act act" "stats stats"; }
  .ig-loc-ro .ig-prof-user { align-self: center; margin: 0; }
  .ig-loc-ro .ig-prof-actions { flex-wrap: nowrap; margin-top: 16px; }
  .ig-loc-ro .ig-prof-actions > .ig-follow-form { display: flex; flex: 1; min-width: 0; }
  .ig-loc-ro .ig-prof-actions > .ig-follow-form .ig-btn { flex: 1; }
  .ig-prof-gear { display: none; }
  .ig-prof-bio { grid-area: bio; margin-top: 16px; }
  .ig-prof-stats { grid-area: stats; justify-content: space-around; gap: 0; margin: 16px -16px 0; padding: 12px 0; border-top: 1px solid var(--ig-line);
    font-size: 14px; color: var(--ig-text-2); text-align: center; }
  .ig-prof-stats li, .ig-prof-stats a { display: flex; flex-direction: column; align-items: center; }
  .ig-stat-d { display: none; }
  .ig-stat-m { display: flex; flex-direction: column; align-items: center; }
  .ig-page-foot { margin-top: 32px; }
  .ig-prof-n { color: var(--ig-text); }
  .ig-highlights { padding: 0 16px 16px; }
  .ig-hl { width: 72px; gap: 8px; }
  .ig-hl-ring { width: 64px; height: 64px; }
  .ig-hl-new { width: 56px; height: 56px; }
  .ig-tabs { gap: 0; }
  .ig-tabs .ig-tab { flex: 1; justify-content: center; }
  .ig-profile > .ig-tabs .ig-tab span, .ig-tagpage > .ig-tabs .ig-tab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ig-profile > .ig-tabs .ig-tab .ig-i { width: 24px; height: 24px; }
  .ig-saved-note { padding: 0 16px; }
  .ig-tag-head { gap: 20px; margin: 4px 16px 20px; }
  .ig-tag-cover { width: 77px; height: 77px; font-size: 32px; }
  .ig-tag-head h1 { font-size: 22px; margin-bottom: 4px; }
  .ig-empty { padding: 40px 16px; }
  .ig-empty h3 { font-size: 22px; line-height: 28px; }

  /* Reels: full screen, black */
  body.ig-l-reels { background: #000; }
  .ig-l-reels .ig-tabbar { background: #000; border-top-color: #262626; }
  .ig-l-reels .ig-tab-item { color: #fff; }
  .ig-l-reels .is-active .ig-side-me { outline-color: #fff; }
  .ig-reels-title { display: block; position: fixed; top: 10px; left: 16px; z-index: 5; margin: 0; color: #fff; font-size: 22px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.4); pointer-events: none; }
  .ig-reels { height: calc(100vh - var(--ig-tab-h)); height: calc(100dvh - var(--ig-tab-h) - env(safe-area-inset-bottom, 0px)); }
  .ig-reel { height: 100%; padding: 0; }
  .ig-reel-stage { width: 100%; height: 100%; gap: 0; }
  .ig-reel-video { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; }
  .ig-reel-info { padding: 72px 72px 18px 14px; }
  .ig-reel-rail { position: absolute; right: 6px; bottom: 16px; z-index: 3; gap: 16px; }
  .ig-reel-rail .ig-act, .ig-reel-n { color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
  .ig-reel-audio { border-color: #fff; }
  .ig-reels .ig-more { height: 80px; }

  /* Story viewer: edge to edge */
  .ig-sv-logo, .ig-sv-close, .ig-sv-nav { display: none !important; }
  .ig-sv-track { gap: 0; }
  .ig-sv-stage { width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; border-radius: 0; }
  .ig-sv-stage::before, .ig-sv-media { border-radius: 0; }
  .ig-sv-x { display: grid; }
  body.ig-l-bare .st-preview { bottom: 84px; }

  /* Create: full screen */
  .ig-create-wrap { padding: 0; background: var(--ig-bg); }
  .ig-create-close { display: none; }
  .ig-create, .ig-create[data-step="edit"] { width: 100%; height: 100%; border-radius: 0; }
  .ig-create-x { display: grid; }
  .ig-create[data-step="edit"] .ig-create-x { display: none; }
  .ig-create-body { flex: 1; height: auto; min-height: 0; overflow-y: auto; }
  .ig-create[data-step="edit"] .ig-create-edit { display: flex; flex-direction: column; height: auto; }
  .ig-create-media { aspect-ratio: 1; flex: none; }
  .ig-create-side { border-left: 0; overflow: visible; }
  .ig-create-caption { min-height: 120px; }

  /* Messages */
  .ig-dm { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--ig-tab-h)); height: calc(100dvh - var(--ig-tab-h) - env(safe-area-inset-bottom, 0px)); }
  .ig-dm.has-open .ig-dm-list { display: none; }
  .ig-dm:not(.has-open) .ig-dm-thread { display: none; }
  body.ig-dm-open { padding-bottom: 0 !important; }
  body.ig-dm-open .ig-tabbar { display: none; }
  body.ig-dm-open .ig-dm { height: 100vh; height: 100dvh; }
  body.ig-dm-open .st-preview { bottom: 72px; }
  .ig-dm-list { border-right: 0; }
  .ig-dm-list-head { padding: 6px 8px 6px 4px; border-bottom: 1px solid var(--ig-line); }
  .ig-dm-me { font-size: 16px; text-align: center; }
  .ig-dm-home { display: grid; }
  .ig-dm-list-sub { padding: 14px 16px 6px; }
  .ig-dm-row { padding: 8px 16px; }
  .ig-dm-head { height: 56px; gap: 8px; padding: 0 8px 0 0; }
  .ig-dm-back { display: grid; }
  .ig-dm-compose { margin: 8px 12px 12px; }
  .ig-msg { max-width: 85%; }

  /* Boost flow: full screen */
  .ig-boost { padding: 0; }
  .ig-boost-card { display: flex; flex-direction: column; max-width: none; min-height: calc(100dvh - var(--ig-tab-h) - env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 0; }
  .ig-boost-step { padding: 16px 16px 8px; }
  .ig-boost-foot { position: sticky; bottom: calc(var(--ig-tab-h) + env(safe-area-inset-bottom, 0px)); margin-top: auto; padding: 10px 16px 12px; border-top: 1px solid var(--ig-line); background: var(--ig-bg); }   /* pinned above the tab bar, as in the app */
  html:has(.ig-boost) { scroll-padding-top: 60px; scroll-padding-bottom: calc(var(--ig-tab-h) + 80px); }   /* focus and scrolling keep fields clear of the sticky bars */
  body.ig:has(.ig-boost-foot) { --st-preview-bottom: calc(var(--ig-tab-h) + 84px + env(safe-area-inset-bottom, 0px)); }   /* the demo switcher above the Next button */
  .ig-boost-bar { padding-left: 14px; padding-right: 14px; }
  .ig-feed [data-ad-hidden] { margin: 0 0 12px; border-right: 0; border-left: 0; border-radius: 0; }

  /* Dialogs: bottom sheets */
  dialog.ig-sheet { width: 100%; max-width: 100%; margin: auto 0 0; }
  .ig-sheet-card { width: 100%; border-radius: 12px 12px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  dialog.ig-modal { width: calc(100vw - 16px); }

  /* Auth */
  .ig-auth-main { align-items: flex-start; padding: 24px 0 0; }
  .ig-auth-col { width: 100%; max-width: 350px; }
  .ig-auth-card { border: 0; }
  .ig-auth-switch { border-top: 1px solid var(--ig-line); }
  .ig-float input { font-size: 16px; }
  .ig-float input:not(:placeholder-shown) { font-size: 14px; }
}

/* Less motion when the viewer asks for it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .ig-mini-media img { animation: none !important; }
  .ig-mini-media img:first-child { opacity: 1; }
  .ig-spinner { animation: ig-spin 1.6s linear infinite !important; }
}
