/* Shared page navigation: the Forum palette and outlined back button. */
html.app-header-html:not(.diary-embedded) { height:100%!important;overflow:hidden!important; }
html:not(.diary-embedded) body.app-header-page { height:100dvh!important;min-height:0!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch; }
body .app-sticky-header.app-sticky-header {
 position:sticky!important;top:0!important;z-index:100;
 padding: max(12px,env(safe-area-inset-top,0px)) 16px 12px;
 background:linear-gradient(145deg,#26371b 0%,#151a16 45%,#342a19 100%);
 border-bottom:1px solid #596445;
 backdrop-filter:none;-webkit-backdrop-filter:none;
 align-items:center;gap:12px;
}
body .forum-header.app-sticky-header { margin:0 -16px 16px; }
body .app-sticky-header > div { min-width:0; }
html:not(.diary-embedded) body .app-sticky-header h1,
html:not(.diary-embedded) body .app-sticky-header h2 { min-width:0;margin:0;font-size:clamp(22px,5vw,30px);line-height:1.15;overflow-wrap:anywhere; }
html:not(.diary-embedded) body .app-sticky-header .section-label { display:block;margin:0 0 5px;color:var(--eo-green);font-size:14px;font-weight:700;line-height:1.2;letter-spacing:.04em; }
body .app-sticky-header.app-sticky-header .app-back-button {
 display:inline-flex;align-items:center;justify-content:center;align-self:center;gap:6px;flex-shrink:0;
 min-height:44px;max-width:46%;padding:10px 15px;
 border:1px solid #657448;border-radius:11px;background:#2c3028;color:var(--eo-green);
 font:inherit;font-size:15px;font-weight:400;line-height:1.2;text-align:center;white-space:normal;text-decoration:none;cursor:pointer;
}
.app-back-button::before { content:'←';flex-shrink:0; }
body .app-sticky-header.app-sticky-header .app-back-button:hover { background:#394130;text-decoration:none; }
body .app-sticky-header.app-sticky-header .app-back-button:focus-visible { outline:2px solid var(--eo-green);outline-offset:3px; }
body .percent-header.app-sticky-header { z-index:2;padding-top:12px; }
/* The tablet diary and inline calculator retain their embedded layout. */
html.diary-embedded body .diary-header.app-sticky-header { position:static!important;background:none;border:0;padding:0;margin:0;gap:8px; }
html.diary-embedded .diary-header .app-back-button { display:none!important; }
@media(max-width:540px){ body .forum-header.app-sticky-header{margin-left:-12px;margin-right:-12px} }
@media(orientation:landscape) and (max-height:499px){ body .app-sticky-header.app-sticky-header{padding-top:max(6px,env(safe-area-inset-top,0px));padding-bottom:6px} }
/* The admin header uses grid columns, so its button must size to its own label. */
body .admin-sticky-header.app-sticky-header .app-back-button { max-width:none;justify-self:end; }
