/* Shared by the live sidebar and Admin preview. Zero/missing settings are legacy. */
.jshRoot { --jsh-base-icon:50px; --jsh-base-target:88px; --jsh-icon:var(--jsh-base-icon); --jsh-target:var(--jsh-base-target); }
.jshRoot[data-header-size="1"] { --jsh-base-icon:34px; --jsh-base-target:60px; }
.jshRoot[data-header-size="2"] { --jsh-base-icon:64px; --jsh-base-target:104px; }
.jshRoot.jshActions .sideBarActions .actionIcons { gap:8px; min-width:0; }
.jshRoot.jshActions .sideBarActions .sideBarAction,
.jshRoot.jshActions .sideBarActions #flag-trigger,
.jshRoot.jshActions .sideBarActions .jshPreviewLanguage {
    display:inline-flex; flex-direction:column; align-items:center; justify-content:center;
    flex:0 0 auto; width:var(--jsh-target); min-width:var(--jsh-target); min-height:var(--jsh-target); height:auto;
    box-sizing:border-box; padding:8px !important; margin:0; border:0; border-radius:0;
    font-size:var(--jsh-icon) !important; line-height:1; color:inherit; text-decoration:none;
    background:transparent; box-shadow:none;
}
.jshRoot.jshActions .sideBarActions .sideBarAction > .icons { font-size:inherit; line-height:1; }
.jshRoot.jshActions .sideBarActions svg { width:var(--jsh-icon); height:var(--jsh-icon); flex:none; }
.jshRoot.jshActions[data-sidebar-actions="1"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage),
.jshRoot.jshActions[data-sidebar-actions="2"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { border:1px solid currentColor; }
.jshRoot.jshActions[data-sidebar-actions="1"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { border-radius:50%; height:var(--jsh-target); }
.jshRoot.jshActions[data-sidebar-actions="2"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { border-radius:8px; height:var(--jsh-target); }
.jshRoot.jshActions .menuSidebarActionLabel { display:none; font-family:var(--jsh-font, sans-serif); font-style:normal; font-weight:normal; font-size:18px; line-height:1.2; text-align:center; overflow-wrap:normal; word-break:normal; hyphens:none; }
.jshRoot.jshActions[data-sidebar-actions="3"] .menuSidebarActionLabel { display:block; margin-top:6px; }
.jshRoot.jshActions[data-sidebar-actions="3"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { width:110px; }
.jshRoot.jshActions .sideBarCulture { position:relative; z-index:2; flex:none; }
/* The language picker floats within the header instead of pushing icons/logo away. */
.jshRoot.jshActions .menuSideBarCultureBtn { position:absolute; inset-inline-end:0; top:100%; width:240px; max-width:calc(100vw - 24px); min-height:52px; height:auto; margin:0; z-index:4; font:25px/1.3 var(--jsh-font,sans-serif); }
.jshRoot.jshActions .sideBarHeader { overflow:visible; }
.jshRoot :is(.sideBarAction,#flag-trigger):focus-visible { outline:3px solid currentColor; outline-offset:3px; }

/* Keep the expanded standard header's original geometry, including when collapse is enabled. */
.jshRoot.jshLayout[data-header-layout="0"]:not(.jshCompact) .sideBarHeader { height:360px; flex:0 0 360px; margin-bottom:19px; }
.jshRoot.jshLayout[data-header-layout="0"]:not(.jshCompact) .sideBarActions { height:330px; margin:25px 0 5px; padding:0 5%; }
/* Only newly styled icons reserve their own row; untouched legacy menus retain their artwork placement. */
.jshRoot.jshActions[data-header-layout="0"]:not(.jshCompact) .sideBarActions-bg-image-container {
    top:var(--jsh-clearance,100px); height:calc(100% - var(--jsh-clearance,100px));
    background-size:contain; background-repeat:no-repeat; background-position:center;
}
.jshRoot.jshLayout .adsApplicationBox { flex:none; }
.jshRoot:is([data-header-layout="1"],.jshCompact) .sideBarHeader { height:auto; flex:0 0 auto; margin-bottom:12px; overflow:visible; box-sizing:border-box; }
.jshRoot:is([data-header-layout="1"],.jshCompact) .sideBarActions {
    display:grid; grid-template-columns:minmax(56px,1fr) auto auto; align-items:center; gap:8px;
    height:172px; margin:0; padding:18px clamp(20px,5%,32px); box-sizing:border-box;
}
.jshRoot.jshCompact .sideBarActions { height:136px; padding-block:16px; }
.jshRoot:is([data-header-layout="1"],.jshCompact) {
    --jsh-target:clamp(44px,11vw,var(--jsh-base-target)); --jsh-icon:min(var(--jsh-base-icon),calc(var(--jsh-target) * .58));
}
.jshRoot:is([data-header-layout="1"],.jshCompact) .actionIcons { grid-column:2; grid-row:1; display:flex; flex-wrap:nowrap; justify-content:flex-end; gap:8px; }
.jshRoot:is([data-header-layout="1"],.jshCompact) .sideBarCulture { grid-column:3; grid-row:1; }
.jshRoot:is([data-header-layout="1"],.jshCompact) .sideBarActions-bg-image-container {
    position:relative; inset:auto; grid-column:1; grid-row:1; width:100%; height:100%; min-width:0;
    background-size:contain; background-position:left center !important; background-repeat:no-repeat;
}
.jshRoot:dir(rtl):is([data-header-layout="1"],.jshCompact) .sideBarActions-bg-image-container { background-position:right center !important; }
.jshRoot:is([data-header-layout="1"],.jshCompact).jshNoArtwork .sideBarActions-bg-image-container { visibility:hidden; }
.jshRoot.jshActions:is([data-header-layout="1"],.jshCompact)[data-sidebar-actions="3"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { width:var(--jsh-target); }
.jshRoot.jshActions:is([data-header-layout="1"],.jshCompact) .menuSidebarActionLabel { font-size:14px; }
.jshRoot.jshActions[data-action-treatment="1"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { border:1px solid currentColor; background:transparent; }
.jshRoot.jshActions[data-action-treatment="2"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { border:0; background:var(--jsh-ink); color:var(--jsh-background) !important; border-radius:10px; }
.jshRoot.jshActions[data-action-treatment="3"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { border:0; background:var(--jsh-soft); border-radius:10px; }
.jshRoot.jshActions[data-action-treatment="4"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { border:0; background:transparent; box-shadow:none; }
.jshRoot.jshCollapse .sideBarBody { overflow-anchor:none; scroll-behavior:auto; }

/* Labelled controls size to complete words; glyphs and first label lines align.
   Fixed icon-only hit boxes must not squeeze Instagram into a broken word. */
.jshRoot.jshActions[data-sidebar-actions="3"] .actionIcons { align-items:flex-start; }
.jshRoot.jshActions[data-sidebar-actions="3"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) {
    width:max-content; justify-content:flex-start; gap:0;
}
.jshRoot.jshActions[data-sidebar-actions="3"] .menuSidebarActionLabel {
    min-height:var(--jsh-label-height,1.2em); max-width:9em;
}
/* Compact/reduced headers may grow for wrapped action rows and longer translations.
   Keep artwork bounded, and leave ads in their original flow above this row. */
.jshRoot.jshActions:is([data-header-layout="1"],.jshCompact)[data-sidebar-actions="3"] .sideBarActions {
    grid-template-columns:minmax(56px,1fr) minmax(0,max-content) auto;
    height:auto; min-height:172px;
}
.jshRoot.jshActions.jshCompact[data-sidebar-actions="3"] .sideBarActions { min-height:136px; }
.jshRoot.jshActions:is([data-header-layout="1"],.jshCompact)[data-sidebar-actions="3"] .actionIcons { flex-wrap:wrap; }
.jshRoot.jshActions:is([data-header-layout="1"],.jshCompact)[data-sidebar-actions="3"] .sideBarActions-bg-image-container { height:136px; }
.jshRoot.jshActions.jshCompact[data-sidebar-actions="3"] .sideBarActions-bg-image-container { height:104px; }
.jshRoot.jshActions:is([data-header-layout="1"],.jshCompact)[data-sidebar-actions="3"] :is(.sideBarAction,#flag-trigger,.jshPreviewLanguage) { width:max-content; padding-inline:5px !important; }
/* Use the header's width in both a scaled Admin preview and the live menu. */
@supports (width:1cqi) {
    .jshRoot:is([data-header-layout="1"],.jshCompact) .sideBarActions { container-type:inline-size; }
    .jshRoot:is([data-header-layout="1"],.jshCompact) { --jsh-target:clamp(44px,11cqi,var(--jsh-base-target)); }
}
