.pwa-offline {padding:1rem;background:#302218;color:#ffedc9;border:1px solid #a38a62;border-radius:.65rem;font:1rem/1.45 system-ui}
.pwa-offline {max-width:min(85vw,25rem)}
.pwa-offline::backdrop {background:#18120dd9}

.mobile-more {display:none}
.mobile-modules {
  width:min(30rem,calc(100% - 1.5rem)); box-sizing:border-box;
  max-height:85dvh; overflow:auto; overscroll-behavior:contain;
  padding:1rem; border:1px solid #967746; border-radius:18px;
  background:#261d16; color:#f7ebd4; box-shadow:0 16px 48px #0008;
}
.mobile-modules::backdrop {background:#110e0ac7}
.mobile-modules header {display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.75rem}
.mobile-modules h2 {margin:0;font:600 1.45rem Georgia,serif}
.mobile-modules header button {min-height:44px;padding:0 .8rem;border:1px solid #88734d;border-radius:9px;background:none;color:inherit}
.mobile-modules nav {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem}
.mobile-module {display:flex;align-items:center;gap:.5rem;padding:.5rem;min-height:48px;border-radius:9px;background:#382a20;color:#faedd6;font-size:.9rem;text-decoration:none}
.mobile-module svg {flex:none;width:20px;height:20px;color:#e3bd7d}
.mobile-module[aria-current="page"] {outline:1px solid #e3bd7d;background:#493722}
@media (max-width:699px) {
  #mainNav.compact-mobile-nav .bottomnav-inner {min-width:0;width:100%;max-width:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
  #mainNav.compact-mobile-nav .navbtn:not([data-view="semana"]):not([data-view="tarefas"]):not([data-view="dieta"]) {display:none}
  #mainNav.compact-mobile-nav :is(.navbtn,.mobile-more) {width:auto;min-width:0;min-height:48px;padding:4px 1px;font:600 12px/1.2 system-ui;white-space:normal}
  .mobile-more {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:transparent;color:#efddbc;border:0;border-radius:8px}
  .mobile-more > span {font-size:18px;line-height:20px;letter-spacing:1px}
  .mobile-more.current-group {background:#483421;color:#ffda8e}
  body[data-page] :is(.panel-login,.sheet,.pl-manager-editor,.hc) :is(input:not([type=checkbox]):not([type=radio]),textarea,select) {font-size:max(16px,1em)}
  .sheet {max-height:85dvh;overscroll-behavior:contain}
  :is(#plPrev,#plNext,#plToday) {min-height:44px}
  :is(#plPrev,#plNext) {min-width:44px}
  #mainNav :focus-visible,.mobile-modules :focus-visible {outline:2px solid #ffe0a0;outline-offset:-2px}
}

/* Shared editing sheet. The native dialog owns focus and background isolation. */
#sheetOverlay:not([open]) {display:none}
#sheetOverlay[open] {margin:0;padding:0;border:0;width:100%;height:100%;max-width:none;max-height:none;color:inherit}
#sheetOverlay::backdrop {background:transparent}
#sheetOverlay .sheet {background:linear-gradient(165deg,#33271e,#221b16);color:#faedd8;border-color:#806749}
#sheetOverlay h3 {color:#ffebc6;line-height:1.25;overflow-wrap:anywhere}
#sheetOverlay .field label {font-size:.84rem;color:#e3d0b5}
#sheetOverlay .field :is(input,select) {color-scheme:dark;background:#201a16;color:#fff3df;border:1px solid #846f57}
#sheetOverlay :is(input,select,button):focus-visible {outline:2px solid #f4c679;outline-offset:2px}
.sheet-feedback:empty {display:none}
.sheet-feedback {color:#ffcfaf;padding:.65rem .8rem;border-left:3px solid #ebaa79;background:#422d23}
#sheetOverlay .sheet-actions {display:grid;grid-template-columns:1fr 1fr;gap:.65rem}
#sheetOverlay .sheet-actions button {min-height:44px}
#sheetOverlay .sheet-actions button:disabled {opacity:.7;cursor:wait}
.goal-card[role=button]:focus-visible {outline:2px solid #f4c679;outline-offset:3px}

.gp-refresh-icon{display:inline-grid;place-items:center;flex:none;margin-inline-start:auto;width:44px;height:44px;border:1px solid #806747;border-radius:50%;background:#30261d;color:#f3d7aa;font:24px/1 system-ui;cursor:pointer}
.gp-refresh-icon:focus-visible{outline:2px solid #f3d7aa;outline-offset:2px}
.gp-refresh-icon[hidden]{display:none}

/* Fontes de 16px evitam a ampliação automática dos campos pelo Safari móvel. */
@media(max-width:900px),(pointer:coarse){
 html body :is(input,textarea,select,[contenteditable="true"]),
 html:root body :is(#app,#panelAccess,#plOverlay) :is(input,textarea,select,[contenteditable="true"]){font-size:16px!important}
}

/* Compatibilidade visual com abas que ainda executam o script antigo. */
html body :is(.pwa-update,.pwa-install){display:none!important}
