/* ESO Social, Instagram layer: stories, viewer, creator, filters, highlights, reels, explore, saved, settings, Direct. */
.av-xs { width: 20px; height: 20px; font-size: .6rem; }
.av-lg { width: 56px; height: 56px; font-size: 1.4rem; }
.ig-noscroll { overflow: hidden; }
.ig-spin { width: 34px; height: 34px; margin: 40px auto; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: #fff; animation: ig-rot .8s linear infinite; }
@keyframes ig-rot { to { transform: rotate(360deg); } }
.ig-big { width: 46px; height: 46px; }

/* story rings */
.ig-ring { display: inline-grid; place-items: center; padding: 3px; border-radius: 50%; border: 0; background: var(--line2); cursor: pointer; flex: none; }
.ig-ring > .av { border: 3px solid var(--card); }
.ig-ring.ig-new { background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); }
.ig-ring.ig-close { background: linear-gradient(135deg, #3ccf4e, #1fa34a); }
.ig-ring.ig-none { background: transparent; }
.ig-ring-xl { padding: 4px; }
.ig-avl { display: inline-flex; }

/* tray */
#ig-tray:empty { display: none; }
.ig-traybox { padding: 12px 14px 8px; }
.ig-tray { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: thin; padding-top: 2px; }
.ig-tb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 74px; flex: none; border: 0; background: none; color: var(--text); cursor: pointer; padding: 0; font: inherit; }
.ig-tb:hover .ig-ring { transform: scale(1.04); }
.ig-tb .ig-ring { transition: transform .15s; }
.ig-tname { font-size: .74rem; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ig-plus { position: absolute; top: 44px; inset-inline-end: 4px; width: 22px; height: 22px; border-radius: 50%; background: #3797f0; color: #fff; font-weight: 800; line-height: 19px; text-align: center; border: 2px solid var(--card); }

/* overlay + story viewer */
.ig-ov { position: fixed; inset: 0; z-index: 150; background: rgba(8, 9, 12, .96); display: flex; align-items: center; justify-content: center; gap: 18px; animation: sx-fade .18s ease; }
.ig-svbox { position: relative; width: min(420px, 100vw); height: min(92vh, 760px); aspect-ratio: 9 / 16; background: #000; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.ig-bars { position: absolute; top: 8px; inset-inline: 8px; display: flex; gap: 4px; z-index: 3; }
.ig-bars > i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.ig-bars > i > b { display: block; height: 100%; width: 0; background: #fff; }
.ig-bars > i.done > b { width: 100% !important; }
.ig-svhead { position: absolute; top: 18px; inset-inline: 10px; z-index: 3; display: flex; align-items: center; gap: 8px; }
.ig-svwho { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: .9rem; text-shadow: 0 1px 3px rgba(0,0,0,.7); min-width: 0; }
.ig-svwho .muted { color: rgba(255,255,255,.75); }
.ig-cf { background: #1fa34a; color: #fff; border-radius: 999px; padding: 0 8px; font-size: .72rem; }
.ig-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; user-select: none; touch-action: manipulation; cursor: pointer; }
.ig-stage > img, .ig-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ig-stext { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; font-size: 1.6rem; font-weight: 800; color: #fff; white-space: pre-wrap; word-break: break-word; }
.ig-scap { position: absolute; bottom: 120px; inset-inline: 14px; margin: 0; padding: 8px 12px; background: rgba(0,0,0,.55); color: #fff; border-radius: 10px; text-align: center; }
.ig-svfoot { position: absolute; bottom: 0; inset-inline: 0; z-index: 3; padding: 30px 10px 12px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.ig-svfoot:empty { display: none; }
.ig-quick { display: flex; justify-content: space-around; }
.ig-q { border: 0; background: none; font-size: 1.5rem; cursor: pointer; transition: transform .12s; padding: 2px 4px; }
.ig-q:hover { transform: scale(1.25); }
.ig-srow { display: flex; gap: 8px; align-items: center; }
.ig-sreply { flex: 1; min-width: 0; background: transparent; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; color: #fff; padding: 9px 16px; font: inherit; }
.ig-sreply::placeholder { color: rgba(255,255,255,.7); }
.ig-svib, .ig-svx, .ig-svnav { border: 0; background: none; color: #fff; cursor: pointer; display: grid; place-items: center; }
.ig-svib svg, .ig-svx svg { width: 26px; height: 26px; }
.ig-svx { position: absolute; top: 14px; inset-inline-end: 18px; }
.ig-svnav { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.16); flex: none; }
.ig-svnav:hover { background: rgba(255,255,255,.3); }
[dir="rtl"] .ig-svnav svg { transform: scaleX(-1); }
.ig-fly { position: absolute; bottom: 20%; left: 50%; font-size: 3rem; animation: ig-fly 1s ease-out forwards; pointer-events: none; }
@keyframes ig-fly { from { transform: translate(-50%, 0) scale(.6); opacity: 1; } to { transform: translate(-50%, -220px) scale(1.5); opacity: 0; } }
.ig-seenby { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: #fff; cursor: pointer; font: inherit; font-size: .85rem; }
.ig-vlist { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; min-width: min(360px, 80vw); }
.ig-vrow, .ig-prow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; color: var(--text); text-decoration: none; border-radius: 10px; }
.ig-vrow:hover { background: var(--card2); }
.ig-vr { font-size: 1.2rem; }
@media (max-width: 640px) { .ig-svnav { display: none; } .ig-svbox { height: 100vh; border-radius: 0; } }

/* story creator */
.ig-ov.ig-sc { background: rgba(4,6,9,.8); }
.ig-scbox { width: min(460px, 94vw); max-height: 94vh; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ig-sctabs { display: flex; gap: 8px; }
.ig-sctab { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 9px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); cursor: pointer; font: inherit; }
.ig-sctab.on { border-color: var(--acc); background: rgba(143,179,217,.14); }
.ig-scpanel { display: flex; flex-direction: column; gap: 10px; }
.ig-scpv { position: relative; aspect-ratio: 9 / 16; max-height: 52vh; background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.ig-scpv img, .ig-scpv video, .ig-scpv canvas { width: 100%; height: 100%; object-fit: contain; }
.ig-scpick { border: 2px dashed var(--line2); background: none; color: var(--muted); border-radius: 12px; padding: 30px; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ig-scta { aspect-ratio: 9 / 16; max-height: 52vh; width: 100%; border: 0; border-radius: 12px; padding: 30px; color: #fff; font: 800 1.4rem/1.4 var(--font); text-align: center; resize: none; }
.ig-scta::placeholder { color: rgba(255,255,255,.8); }
.ig-scbgs { display: flex; gap: 8px; justify-content: center; }
.ig-scfoot { align-items: center; }

/* filters */
.ig-filters, .ig-frow { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.ig-fbtn { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: .72rem; padding: 0; }
.ig-fbtn canvas { width: 64px; height: 64px; border-radius: 8px; border: 2px solid transparent; }
.ig-fbtn.on { color: var(--text); font-weight: 700; }
.ig-fbtn.on canvas { border-color: var(--acc); }
.ig-copts { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.ig-chks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ig-chk { display: inline-flex; gap: 6px; align-items: center; font-size: .86rem; cursor: pointer; }

/* posts: double-tap heart, comment off */
.ig-tapw { position: relative; }
.ig-heart, .ig-rheart { position: absolute; top: 50%; left: 50%; font-size: 5.5rem; pointer-events: none; animation: ig-pop .9s ease forwards; z-index: 4; filter: drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
@keyframes ig-pop { 0% { transform: translate(-50%,-50%) scale(0); opacity: 0; } 15% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; } 30% { transform: translate(-50%,-50%) scale(.95); } 70% { opacity: 1; } 100% { transform: translate(-50%,-80%) scale(1); opacity: 0; } }
.ig-rheart:not(.go) { animation: none; opacity: 0; }
.ig-off { opacity: .45; }

/* profile bits */
.ig-pfav { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.ig-note { position: absolute; top: -12px; inset-inline-start: 50%; transform: translateX(-30%); background: var(--card2); border: 1px solid var(--line2); border-radius: 14px; padding: 3px 10px; font-size: .75rem; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.ig-active { display: inline-flex; align-items: center; gap: 5px; color: var(--green); }
.ig-active i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.ig-views { position: absolute; bottom: 6px; inset-inline-start: 8px; display: flex; gap: 4px; align-items: center; color: #fff; font-size: .78rem; font-weight: 700; text-shadow: 0 1px 3px #000; }
.ig-privnote { text-align: center; }
.ig-hlbox { padding: 12px 14px; margin-bottom: 14px; }
.ig-hls { display: flex; gap: 16px; overflow-x: auto; }
.ig-hl { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; flex: none; border: 0; background: none; color: var(--text); text-decoration: none; cursor: pointer; font: inherit; font-size: .74rem; padding: 0; }
.ig-hl > span:last-child { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-hlc { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; border: 2px solid var(--line2); outline: 3px solid var(--card); outline-offset: -5px; display: grid; place-items: center; background: var(--card2); }
.ig-hlc img { width: 100%; height: 100%; object-fit: cover; }
.ig-hlnew { border-style: dashed; color: var(--muted); }

/* views (explore / tags / saved / archive / settings / requests) */
.ig-view { display: flex; flex-direction: column; gap: 14px; }
.ig-vhead { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.ig-vhead h1 { margin: 0; font-size: 1.35rem; }
.ig-vhead p { margin: 2px 0 0; }
.ig-vic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #fa7e1e, #d62976, #4f5bd5); color: #fff; flex: none; }
.ig-search { position: relative; }
.ig-qic { position: absolute; top: 12px; inset-inline-start: 14px; width: 18px; height: 18px; color: var(--muted); }
.ig-search .ig-q, .ig-pickw .inp { -webkit-appearance: none; appearance: none; background: #0e1116; border: 1px solid var(--line2); color: var(--text); }
.ig-search .ig-q { width: 100%; padding-top: 11px; padding-bottom: 11px; font-size: 1rem; padding-inline-start: 42px; border-radius: 999px; }
.ig-qres { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 30; padding: 10px; max-height: 60vh; overflow: auto; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.ig-qres h4 { margin: 6px 4px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.ig-tagrow { display: flex; align-items: center; gap: 10px; padding: 6px 4px; color: var(--text); text-decoration: none; border-radius: 10px; }
.ig-tagrow:hover { background: var(--card2); }
.ig-hash { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.ig-grid { gap: 3px; }
.ig-grid .pf2-txt span, .ig-acell > .sx-bg { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; color: #fff; font-weight: 700; font-size: .85rem; text-align: center; overflow: hidden; }
.ig-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ig-chip { border: 1px solid var(--line2); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: .86rem; }
.ig-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ig-hlbar { padding: 12px 14px; }
.ig-hlbar .row { gap: 8px; }
.ig-adate { position: absolute; top: 6px; inset-inline-start: 6px; background: rgba(255,255,255,.92); color: #111; border-radius: 6px; padding: 0 6px; font-size: .7rem; font-weight: 800; line-height: 1.6; }
.ig-acell.ig-live { outline: 2px solid #d62976; outline-offset: -2px; }
.ig-tick { position: absolute; bottom: 6px; inset-inline-end: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; display: none; place-items: center; color: #fff; font-size: .8rem; font-weight: 800; background: rgba(0,0,0,.3); }
.ig-picking .ig-tick { display: grid; }
.ig-acell.on .ig-tick { background: #3797f0; border-color: #3797f0; }
.ig-acell.on img { opacity: .7; }
.ig-setcard { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.ig-setcard h3 { margin: 0; }
.ig-set { display: flex; gap: 14px; align-items: center; justify-content: space-between; cursor: pointer; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ig-set:last-of-type { border-bottom: 0; }
.ig-set p { margin: 2px 0 0; }
.ig-sw { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line2); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.ig-sw::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.ig-sw:checked { background: #3797f0; }
.ig-sw:checked::after { inset-inline-start: 23px; }
.ig-sw:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.ig-plist { display: flex; flex-direction: column; gap: 2px; }
.ig-plist.card { padding: 10px 14px; }
.ig-prow a { color: var(--text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-pickw { position: relative; }
.ig-pickw .inp { width: 100%; }
.ig-pres { display: flex; flex-direction: column; }
.ig-pick { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border: 0; background: none; color: var(--text); border-radius: 10px; cursor: pointer; font: inherit; text-align: start; }
.ig-pick:hover { background: var(--card2); }

/* reels */
.ig-viewmain .ig-reelsview { align-items: center; }
.ig-reels { height: calc(100vh - 110px); width: min(440px, 100%); overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; display: flex; flex-direction: column; gap: 14px; }
.ig-reels::-webkit-scrollbar { display: none; }
.ig-reel { position: relative; flex: none; height: calc(100vh - 124px); scroll-snap-align: start; scroll-snap-stop: always; border-radius: 14px; overflow: hidden; background: #000; }
.ig-rstage { position: absolute; inset: 0; cursor: pointer; }
.ig-rstage video { width: 100%; height: 100%; object-fit: cover; }
.ig-snd { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; font-size: 1.6rem; }
.ig-rside { position: absolute; bottom: 90px; inset-inline-end: 8px; display: flex; flex-direction: column; gap: 16px; z-index: 2; }
.ig-rbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: #fff; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }
.ig-rbtn svg { width: 28px; height: 28px; transition: transform .15s; }
.ig-rbtn:active svg { transform: scale(.85); }
.ig-rbtn.on svg { fill: #ff3040; stroke: #ff3040; }
.ig-rbtn.on:last-child svg { fill: #fff; stroke: #fff; }
.ig-rinfo { position: absolute; bottom: 0; inset-inline: 0; padding: 60px 64px 14px 14px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; pointer-events: none; }
[dir="rtl"] .ig-rinfo { padding: 60px 14px 14px 64px; }
.ig-rinfo a, .ig-rinfo button { pointer-events: auto; }
.ig-rwho { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ig-rwho a { color: #fff; text-decoration: none; }
.ig-rwho .btn { padding: 2px 10px; min-height: 0; font-size: .78rem; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.8); }
.ig-rcap { margin: 6px 0 2px; max-height: 4.8em; overflow: hidden; font-size: .9rem; }
.ig-rcap a { color: #fff; font-weight: 700; }
.ig-rviews { display: flex; gap: 4px; align-items: center; margin: 0; opacity: .85; }
@media (max-width: 700px) { .ig-reels { height: calc(100vh - 140px); } .ig-reel { height: calc(100vh - 150px); border-radius: 0; } }

/* send / save sheets */
.ig-sendbox, .ig-newmsg, .ig-collpick, .ig-details { display: flex; flex-direction: column; gap: 10px; min-width: min(380px, 84vw); }
.ig-sendlist { max-height: 40vh; overflow: auto; display: flex; flex-direction: column; }
.ig-sendrow { cursor: pointer; }
.ig-sendrow input { width: 20px; height: 20px; accent-color: #3797f0; }
.ig-collrow { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; font: inherit; text-align: start; }
.ig-collrow:hover { background: var(--card2); }
.ig-collrow img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.ig-collrow.bad { color: var(--red); }
.ig-details h4 { margin: 0; color: var(--muted); font-size: .8rem; }

/* ═════ Direct ═════ */
.sx.ig-dm { grid-template-columns: 250px minmax(0, 1040px); padding-bottom: 22px; }
.ig-dm #dm { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 120px); min-height: 480px; padding: 0; overflow: hidden; }
.ig-dml { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ig-dmlh { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.ig-dmlh h2 { margin: 0; font-size: 1.15rem; }
.ig-notes { display: flex; gap: 12px; overflow-x: auto; padding: 26px 16px 8px; flex: none; }
.ig-notec { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; flex: none; border: 0; background: none; color: var(--text); text-decoration: none; cursor: pointer; font: inherit; padding: 0; }
.ig-notec > .small { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ig-nb { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); max-width: 92px; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; padding: 2px 8px; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.ig-nb.empty { color: var(--muted); }
.ig-dmtabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.ig-dmtab { flex: 1; border: 0; background: none; color: var(--muted); padding: 10px; cursor: pointer; font: inherit; font-weight: 700; border-bottom: 2px solid transparent; }
.ig-dmtab.on { color: var(--text); border-bottom-color: var(--text); }
.ig-reqn { color: #3797f0; }
.ig-dmlist { flex: 1; overflow-y: auto; padding: 6px 0; }
.ig-dmnone { padding: 16px 18px; }
.ig-thr { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 18px; border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; text-align: start; }
.ig-thr:hover { background: var(--card2); }
.ig-thr.on { background: rgba(143,179,217,.12); }
.ig-thr.unread strong, .ig-thr.unread .ig-thtx .small { color: var(--text); font-weight: 800; }
.ig-thav { position: relative; flex: none; }
.ig-on { position: absolute; bottom: 2px; inset-inline-end: 2px; width: 14px; height: 14px; border-radius: 50%; background: #3ccf4e; border: 3px solid var(--card); }
.ig-thtx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ig-thtx > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-dot { width: 9px; height: 9px; border-radius: 50%; background: #3797f0; flex: none; }
.ig-gav { position: relative; display: inline-block; width: 56px; height: 56px; flex: none; }
.ig-gav .av { position: absolute; width: 38px; height: 38px; border: 2px solid var(--card); }
.ig-gav .av:first-child { top: 0; inset-inline-start: 0; }
.ig-gav .av:last-child { bottom: 0; inset-inline-end: 0; }
.ig-dmh .ig-gav { width: 40px; height: 40px; }
.ig-dmh .ig-gav .av { width: 28px; height: 28px; }
.ig-gav-xl { width: 110px; height: 110px; }
.ig-gav-xl .av { width: 76px; height: 76px; }
.ig-dmr { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ig-dmph { margin: auto; text-align: center; padding: 30px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ig-dmph h2 { margin: 8px 0 0; font-size: 1.2rem; }
.ig-dmphic { width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--text); display: grid; place-items: center; }
.ig-dmphic svg { width: 44px; height: 44px; }
.ig-dmh { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.ig-dmht { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ig-dmht > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-back { display: none; }
[dir="rtl"] .ig-back svg { transform: scaleX(-1); }
.ig-dmlog { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; }
.ig-dmtop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 26px; }
.ig-dmtop h3 { margin: 4px 0; }
.ig-older { align-self: center; margin-bottom: 8px; }
.ig-msgs { display: flex; flex-direction: column; gap: 2px; }
.ig-sys { text-align: center; padding: 8px 0; }
.ig-msg { position: relative; display: flex; align-items: flex-end; gap: 8px; max-width: 78%; }
.ig-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.ig-msg.ig-run-end { margin-bottom: 8px; }
.ig-msg.ig-newday::before { content: attr(data-day); position: absolute; top: -26px; left: 0; right: 0; }
.ig-msgs > .ig-newday { margin-top: 34px; }
.ig-msgs > .ig-newday:first-child { margin-top: 24px; }
.ig-msg.ig-newday::before { width: max-content; margin: 0 auto; color: var(--muted); font-size: .72rem; }
.ig-msg.mine.ig-newday::before { inset-inline-end: 0; }
.ig-mav { visibility: hidden; flex: none; width: 28px; height: 28px; }
.ig-run-end .ig-mav { visibility: visible; }
.ig-mcol { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.mine .ig-mcol { align-items: flex-end; }
.ig-mname { padding: 0 12px; }
.ig-bub { padding: 8px 14px; border-radius: 20px; background: var(--card2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; max-width: 100%; }
.mine .ig-bub { background: linear-gradient(135deg, #3797f0, #6a5af9); color: #fff; border-color: transparent; }
.mine .ig-bub a { color: #fff; }
.ig-bub.ig-big-emoji { background: none !important; border: 0; font-size: 2.6rem; padding: 0 4px; line-height: 1.2; }
.ig-bub.ig-unsent { background: none; border: 1px dashed var(--line2); color: var(--muted); font-style: italic; }
.ig-mquote { border-inline-start: 3px solid var(--line2); padding: 2px 10px; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-mstory { border: 0; padding: 0; background: none; cursor: pointer; width: 120px; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; display: block; position: relative; }
.ig-mstory img { width: 100%; height: 100%; object-fit: cover; }
.ig-mstory .sx-bg { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; padding: 8px; font-size: .78rem; }
.ig-mstory.gone, .ig-mpost.gone { width: auto; aspect-ratio: auto; padding: 8px 12px; border: 1px dashed var(--line2); border-radius: 12px; }
.ig-mpost { width: 240px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); border-radius: 16px; overflow: hidden; padding: 0; cursor: pointer; font: inherit; text-align: start; display: flex; flex-direction: column; }
.ig-mph { display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-size: .85rem; }
.ig-mpost img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ig-mpb { padding: 8px 10px; max-height: 4.5em; overflow: hidden; }
.ig-mmedia { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.mine .ig-mmedia { justify-content: flex-end; }
.ig-mmedia img, .ig-mmedia video { max-width: 260px; max-height: 320px; border-radius: 16px; display: block; }
.ig-mreacts { display: flex; gap: 2px; margin-top: -10px; padding: 0 8px; z-index: 1; }
.ig-mreacts span { background: var(--card); border: 1px solid var(--line2); border-radius: 999px; padding: 0 6px; font-size: .78rem; }
.ig-mreacts span.mine { border-color: #3797f0; }
.ig-mtools { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; align-self: center; position: relative; }
.ig-msg:hover .ig-mtools, .ig-mtools:focus-within { opacity: 1; }
.ig-mt { border: 0; background: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; padding: 0; }
.ig-mt:hover { background: var(--card2); color: var(--text); }
.ig-epick { position: absolute; bottom: 34px; inset-inline-end: 0; display: flex; gap: 2px; padding: 4px 6px; border-radius: 999px; z-index: 5; box-shadow: 0 8px 26px rgba(0,0,0,.5); }
.ig-seen, .ig-typing { align-self: flex-end; padding: 0 6px; }
.ig-typing { align-self: flex-start; display: flex; gap: 6px; align-items: center; }
.ig-dots { display: inline-flex; gap: 3px; background: var(--card2); border-radius: 999px; padding: 8px 10px; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ig-dot 1.2s infinite; }
.ig-dots i:nth-child(2) { animation-delay: .15s; } .ig-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ig-dot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.ig-reqb { border-top: 1px solid var(--line); padding: 12px 16px; text-align: center; flex: none; }
.ig-reqb .row { justify-content: center; gap: 8px; }
.ig-dmcomp { padding: 10px 16px 14px; flex: none; }
.ig-replybar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 6px; }
.ig-replybar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-dmrow { display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--line2); border-radius: 24px; padding: 6px 8px 6px 16px; background: var(--card); }
[dir="rtl"] .ig-dmrow { padding: 6px 16px 6px 8px; }
.ig-dmta { flex: 1; border: 0; background: none; color: var(--text); font: inherit; resize: none; padding: 6px 0; max-height: 140px; outline: none; }
.ig-dmib { border: 0; background: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text); font-size: 1.15rem; padding: 0; }
.ig-dmib:hover { background: var(--card2); }
.ig-sendb { color: #3797f0; font-weight: 800; padding: 6px 8px; }
@media (max-width: 760px) {
  .sx.ig-dm { grid-template-columns: 1fr; padding: 0; }
  .ig-dm #dm { grid-template-columns: 1fr; height: calc(100vh - 150px); border-radius: 0; }
  .ig-dm #dm .ig-dmr { display: none; }
  .ig-dm #dm.ig-open .ig-dml { display: none; }
  .ig-dm #dm.ig-open .ig-dmr { display: flex; }
  .ig-back { display: grid; }
  .ig-msg { max-width: 90%; }
  .ig-mtools { opacity: .55; } .ig-mt { width: 24px; height: 24px; }
}
@media (max-width: 860px) { .sx-nav { overflow-x: auto; justify-content: start !important; scrollbar-width: none; } }
select.inp.sx-vis { -webkit-appearance: none; appearance: none; background-color: #0e1116; color: var(--text); min-width: 0; padding-inline-end: 14px; cursor: pointer; }
select.inp.sx-vis option { background: #14181e; color: var(--text); }
