/* Instagram controls and content are laid out by Jase, never by a scaled page. */
#tool-menu[data-kind="player"]:has(.instagram-panel){width:min(460px,calc(100vw - 20px));overflow:hidden;}
.instagram-panel{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0;max-height:calc(100vh - var(--tabs) - var(--toolbar) - var(--bookmarks) - 80px);}
.instagram-panel>.instagram-navigation,.instagram-panel>.instagram-compose,.instagram-panel>.player-footer,.instagram-panel>.instagram-status{flex:none;}
.instagram-navigation,.instagram-home-head,.instagram-post-head,.instagram-actions,.instagram-turn{display:flex;align-items:center;gap:10px;min-width:0;}
.instagram-navigation>button{flex:1;}
#tool-menu .instagram-navigation button,#tool-menu .instagram-turn button,#tool-menu .instagram-submit{border:0;border-bottom:1px solid currentColor;border-radius:0;background:transparent;box-shadow:none;padding:8px 16px;justify-content:center;}
#tool-menu .instagram-navigation button:hover,#tool-menu .instagram-navigation button[aria-current="page"],#tool-menu .instagram-turn button:hover,#tool-menu .instagram-submit:hover{color:var(--o-ff5000, #ff5000);border-bottom-color:var(--o-ff5000, #ff5000);background:transparent;box-shadow:none;}
.instagram-navigation>button:last-child{flex:none;width:32px;padding:7px!important;}
.instagram-body{height:min(650px,max(220px,calc(100vh - var(--tabs) - var(--toolbar) - var(--bookmarks) - 185px)));flex:1 1 auto;overflow:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;display:flex;flex-direction:column;gap:12px;min-width:0;min-height:140px;overflow-anchor:none;}
.instagram-body>*{flex:none;min-width:0;box-sizing:border-box;}
.instagram-home-head{justify-content:space-between;}
.instagram-home-head>strong{font-size:16px;}
.instagram-stories{display:flex;gap:10px;overflow-x:auto;padding:3px 1px 8px;scrollbar-width:thin;}
#tool-menu .instagram-stories button{display:flex;flex:none;flex-direction:column;width:64px;height:auto;padding:3px;gap:5px;background:none;}
.instagram-stories button>span:last-child{max-width:62px;overflow:hidden;text-overflow:ellipsis;font-size:11px;white-space:nowrap;}
.instagram-avatar{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;object-fit:cover;background:#e8e8eb;color:#4b4b53;font-size:13px;font-weight:600;}
.instagram-stories .instagram-avatar{width:48px;height:48px;outline:2px solid #e64585;outline-offset:2px;}
.instagram-post-head>strong{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;}
.instagram-post-head>small{font-size:11px;opacity:.65;}
.instagram-feed{display:flex;flex-direction:column;gap:24px;}
.instagram-feed-view{display:flex;flex-direction:column;gap:12px;min-width:0;}
.instagram-stories button[data-seen="true"] .instagram-avatar{outline-color:#93939b;}
.instagram-story-head button[hidden]{display:none!important;}
.instagram-share-search{width:100%;box-sizing:border-box;padding:10px;border:0;border-bottom:1px solid #8887;background:transparent;color:inherit;font:inherit;}
.instagram-recipients{display:flex;flex-direction:column;gap:5px;}
.instagram-recipients button[aria-pressed="true"]{background:#ad65dd30!important;}
.instagram-post{display:flex;flex-direction:column;gap:12px;padding-bottom:18px;border-bottom:1px solid #8883;scroll-margin-top:12px;}
.instagram-media{position:relative;aspect-ratio:4/5;background:#101114;border-radius:10px;overflow:hidden;width:100%;flex:none;}
.instagram-poster{display:block;width:100%;height:100%;object-fit:contain;position:absolute;inset:0;}
.instagram-avatar{position:relative;overflow:hidden;}
.instagram-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
#tool-menu .instagram-actions button{display:flex;gap:5px;align-items:center;justify-content:center;min-width:30px;width:auto;min-height:32px;padding:5px;background:none;}
#tool-menu .instagram-actions button[aria-pressed="true"]{color:#ed3564;}
#tool-menu .instagram-actions button[aria-pressed="true"] svg{fill:#ed3564;}
.instagram-actions .icon{width:21px;height:21px;}
.instagram-actions>button:last-child{margin-left:auto;}
.instagram-actions [hidden],.instagram-carousel[hidden],.instagram-volume[hidden]{display:none!important;}
.instagram-carousel{display:flex;justify-content:space-between;gap:12px;}
.instagram-media{touch-action:pan-y;user-select:none;cursor:default;}
.instagram-volume{display:flex;align-items:center;gap:10px;font-size:12px;}
.instagram-volume input{flex:1;min-width:0;accent-color:var(--o-ff5000, #ff5000);cursor:pointer;}
#tool-menu .instagram-caption{margin:0;line-height:1.5;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;color:inherit;}
.instagram-turn{justify-content:space-between;margin-top:auto;padding-bottom:4px;}
.instagram-comments{display:grid;gap:16px;}
.instagram-comment{display:flex;gap:9px;padding:3px 0;}
.instagram-comment>div{flex:1;min-width:0;}
.instagram-comment[data-depth="1"]{margin-left:28px;}
.instagram-attachments{display:flex;flex-wrap:wrap;gap:6px;min-width:0;}
.instagram-attachments img,.instagram-attachments video{display:block;max-width:100%;width:auto;max-height:300px;object-fit:contain;border-radius:8px;}
.instagram-comment button{margin-top:8px;font-size:11px;}
.instagram-comment strong{font-size:12px;}
#tool-menu .instagram-comment p{margin:3px 0;font-size:13px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;color:inherit;}
.instagram-comment small{font-size:10px;opacity:.6;}
#tool-menu .instagram-chat{display:flex;align-items:center;gap:10px;text-align:left;width:100%;height:auto;min-height:54px;}
.instagram-chat>span:last-child{white-space:normal;overflow-wrap:anywhere;}
.instagram-chat strong,.instagram-chat small{display:block;}
.instagram-chat small{font-size:11px;opacity:.65;margin-top:4px;}
.instagram-messages{display:flex;flex-direction:column;gap:8px;}
#tool-menu .instagram-message{align-self:flex-start;max-width:90%;margin:0;padding:8px 10px;background:#88888818;border-radius:12px;white-space:pre-wrap;overflow-wrap:anywhere;color:inherit;}
#tool-menu .instagram-message[data-out="true"]{align-self:flex-end;background:#ad65dd26;}
#tool-menu .instagram-message p{color:inherit;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;}
.instagram-story-overlay{position:absolute;inset:42px 6px 45px;z-index:4;display:flex;flex-direction:column;gap:8px;background:#101114;color:white;border-radius:12px;padding:10px;overflow:hidden;box-shadow:0 0 0 100px #0008;}
.instagram-story-head{display:flex;align-items:center;gap:5px;flex:none;}
.instagram-story-head strong{flex:1;overflow:hidden;text-overflow:ellipsis;font-size:13px;}
#tool-menu .instagram-story-head button,#tool-menu .instagram-story-head button .icon{color:white;}
.instagram-story-overlay .instagram-media{flex:1 1 auto;min-height:0;aspect-ratio:auto!important;cursor:pointer;}
.instagram-story-progress{width:100%;height:3px;flex:none;accent-color:white;}
.instagram-compose{display:flex;gap:10px;align-items:flex-end;border-top:1px solid #88888838;padding-top:8px;}
.instagram-compose[hidden]{display:none;}
#tool-menu .instagram-compose textarea{flex:1;resize:vertical;min-width:0;max-height:100px;border:0;border-bottom:1px solid #88888870;border-radius:0;background:none;color:inherit;padding:6px;font:inherit;}
#tool-menu .instagram-empty{margin:auto 6px;font-size:13px;line-height:1.5;opacity:.7;color:inherit;}
#tool-menu .instagram-status{margin:0;font-size:11px;line-height:1.35;color:inherit;}
.instagram-status:empty{display:none;}

.instagram-body>.instagram-share-view{flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;overflow:hidden;}
.instagram-share-view>.instagram-recipients{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;}
.instagram-share-view>.instagram-share-back,.instagram-share-view>.instagram-share-search,.instagram-share-view>.instagram-share-hint,.instagram-share-footer{flex:none;}
#tool-menu .instagram-share-hint,#tool-menu .instagram-share-summary{margin:0;font-size:12px;line-height:1.4;color:inherit;}
.instagram-share-footer{display:grid;gap:8px;padding-top:10px;border-top:1px solid #8885;}
#tool-menu .instagram-share-next,#tool-menu .instagram-share-send{width:100%;min-height:38px;justify-content:center;background:var(--o-ff5000, #ff5000);color:white;}
#tool-menu .instagram-share-view [hidden]{display:none!important;}
.instagram-share-footer button:disabled{opacity:.5;}

.instagram-body[data-mode="reels"]{overflow:hidden;touch-action:none;}
.instagram-body>.instagram-reel-view{flex:1;min-height:0;position:relative;display:flex;flex-direction:column;}
.instagram-reel-view>.instagram-feed{flex:1;min-height:0;gap:0;}
.instagram-reel-view .instagram-post{height:100%;min-height:0;box-sizing:border-box;gap:8px;padding:0;border:0;}
.instagram-reel-view .instagram-media{flex:1 1 auto;min-height:100px;aspect-ratio:auto!important;}
.instagram-reel-view .instagram-post-head,.instagram-reel-view .instagram-actions,.instagram-reel-view .instagram-volume{flex:none;}
#tool-menu .instagram-reel-view .instagram-caption{flex:none;max-height:3em;overflow:hidden;}
#tool-menu .instagram-reel-status{position:absolute;left:8px;right:8px;top:48px;margin:0;padding:8px;border-radius:8px;text-align:center;font-size:12px;background:#15151cdd;color:white;pointer-events:none;}
.instagram-reel-status:empty{display:none;}
