/* Shared panel footer. Auth/Entry/embedded layouts do not opt into this shell. */
:root { --ep-panel-footer-height:64px; --ep-panel-footer-inline-space:24px; }
html:not(.ep-home-root) > body.ep-panel-footer-layout {
    display:flex; flex-direction:column; min-height:100svh; height:auto; box-sizing:border-box;
}
html:not(.ep-home-root) > body.ep-panel-footer-layout > .ep-panel-page-content {
    display:flow-root; flex:1 0 auto; min-height:0; height:auto !important;
}
/* Legacy panels were absolutely positioned at document y=0. Retain that offset in flow. */
html:not(.ep-home-root) .ep-panel-page-content > .epoll-main-container > .epoll-main-content:not(:has(#ep-settings-pilot)) {
    position:relative; top:auto; height:auto !important; margin-top:-50px;
}
.ep-panel-footer {
    display:flex; flex:0 0 auto; flex-wrap:wrap; align-items:center; justify-content:space-between;
    gap:12px 24px; box-sizing:border-box; width:100%; min-height:64px; margin:0;
    padding:10px var(--ep-panel-footer-inline-space); background:transparent; border:0;
    color:#596579; font-family:inherit; font-size:12px; line-height:1.7; text-align:left;
}
.ep-panel-footer-credit { display:flex; flex-wrap:wrap; align-items:center; gap:4px 16px; margin:0; }
.ep-panel-footer-credit strong { color:inherit; font-weight:700; }
.ep-panel-footer .ep-panel-footer-copyright-start { color:#ff9800; }
.ep-panel-footer-brand { color:#0c5d56; }
.ep-panel-footer-version { white-space:nowrap; }
.ep-panel-footer-links { display:flex; flex-wrap:wrap; align-items:center; gap:16px; }
.ep-panel-footer-links a {
    display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px;
    padding:4px 0; color:#596579 !important; text-decoration:none;
}
.ep-panel-footer-links a:hover { color:#2d3748 !important; text-decoration:underline; }
.ep-panel-footer-links a:focus-visible { outline:2px solid #1b7165; outline-offset:3px; border-radius:4px; }
/* Keep footer content clear of the existing fixed action bar and physical-left AI launcher. */
html:not(.ep-home-root) body.ep-panel-footer-layout:has(.ep-panel-page-content .custom-action-bottom) > .ep-panel-footer { padding-bottom:82px; }
html:not(.ep-home-root) body.ep-panel-footer-layout:has(.epoll-ai-launcher:not([hidden])) > .ep-panel-footer { padding-left:calc(80px + var(--ep-panel-footer-inline-space)); }
@media (min-width:992px) {
    :root { --ep-panel-footer-inline-space:72px; }
    html:not(.ep-home-root) body.ep-panel-footer-layout:has(#ep-settings-pilot) > .ep-panel-footer { padding-bottom:10px; }
    html[dir=rtl]:not(.ep-home-root) body.ep-panel-footer-layout:has(.epoll-main-navigation:not(.hidden-lg)) > .ep-panel-footer { padding-right:calc(196px + var(--ep-panel-footer-inline-space)); }
    html[dir=ltr]:not(.ep-home-root) body.ep-panel-footer-layout:has(.epoll-main-navigation:not(.hidden-lg)) > .ep-panel-footer { padding-left:calc(196px + var(--ep-panel-footer-inline-space)); }
}

/* One desktop footer footprint: canonical sidebars stay full width even when
   the legacy body still carries navigation-small. Never place links under it. */
@media (min-width:992px) {
 html > body.ep-panel-footer-layout > #ep-panel-footer {
  width:auto!important; min-width:0; align-self:stretch; flex:0 0 auto;
  margin:0!important; padding:10px var(--ep-panel-footer-inline-space,72px)!important;
  min-height:64px; direction:ltr; align-items:center; overflow:visible;
 }
 html[dir="rtl"]:not(.ep-builder-shell-root) > body.ep-panel-workspace:has(:is(#ep-settings-pilot>.ep-settings-sidebar,#menu-bar.ep-canonical-sidebar,#ep-home-sidebar)) > #ep-panel-footer {
  margin-right:var(--ep-home-sidebar-width,232px)!important;
 }
 html[dir="ltr"]:not(.ep-builder-shell-root) > body.ep-panel-workspace:has(:is(#ep-settings-pilot>.ep-settings-sidebar,#menu-bar.ep-canonical-sidebar,#ep-home-sidebar)) > #ep-panel-footer {
  margin-left:var(--ep-home-sidebar-width,232px)!important;
 }
 #ep-panel-footer .ep-panel-footer-credit { min-width:0; max-width:100%; }
 #ep-panel-footer .ep-panel-footer-links { flex:0 0 auto; flex-wrap:nowrap; }
}
@media (max-width:767px) {
    .ep-panel-footer { padding-inline:16px; gap:8px 16px; }
    .ep-panel-footer-links { gap:12px; }
}
@media print { .ep-panel-footer { display:none !important; } }

/* Same footer navigation on every desktop panel; hidden groups stay hidden. */
@media (min-width:992px) {
 .ep-panel-footer .ep-panel-footer-scroll { display:inline-flex; align-items:center; gap:4px; min-height:44px; }
 .ep-panel-footer .ep-panel-footer-scroll[hidden] { display:none!important; }
 #ep-panel-footer.ep-panel-footer .ep-panel-footer-scroll > :is(#back-to-top,#go-to-bottom) {
  display:inline-flex!important; position:static!important; inset:auto!important; float:none!important;
  align-items:center; justify-content:center; flex:0 0 44px;
  width:44px!important; height:44px!important; min-width:44px; margin:0!important; padding:0!important;
  border:0!important; border-radius:8px; background:transparent!important; box-shadow:none!important;
  opacity:1!important; color:#4fd1c5!important; line-height:1; text-decoration:none;
 }
 #ep-panel-footer.ep-panel-footer .ep-panel-footer-scroll > :is(#back-to-top,#go-to-bottom)[aria-disabled="true"] { opacity:.45!important; cursor:default; }
 #ep-panel-footer.ep-panel-footer .ep-panel-footer-scroll > :is(#back-to-top,#go-to-bottom) > .fa {
  display:block; position:static; margin:0!important; color:inherit!important; font-size:18px; line-height:1;
 }
 #ep-panel-footer.ep-panel-footer .ep-panel-footer-scroll > :is(#back-to-top,#go-to-bottom):focus-visible { outline:2px solid #1b7165; outline-offset:-2px; }
}
