/* Only Menu is sticky: its containing block is the whole application, not the
   short title header. Existing navigation nodes and click handlers are kept. */
.main-menu-row140{position:sticky;top:0;z-index:12;max-width:760px;margin-inline:auto;padding:12px 22px 8px;background:var(--paper,#f8faf6);box-sizing:border-box;padding-top:max(12px,env(safe-area-inset-top))}
.main-menu-row140>.menu-button{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:54px;padding:9px 20px;font-size:1.3125rem;font-weight:600;border-radius:12px}
.main-menu-row140>.menu-button{background:#edf2e9;border:1px solid var(--line,#cbd6ce)}
/* overflow:hidden on the decorative device frame creates a non-scrolling
   ancestor for sticky. clip keeps its rounded clipping without that trap. */
#device:has(.main-page140){overflow:clip}
.main-page140 .top{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:0;height:auto;max-width:760px;margin-inline:auto;padding:0 22px;box-sizing:border-box;border-bottom:0}
.main-page140 .top>.menu-title{grid-column:1/-1;grid-row:1;min-width:0;min-height:44px;margin:8px 0;padding-inline:44px;font-size:clamp(1.35rem,6.9vw,1.6875rem);line-height:1.25;text-align:center;align-content:center;overflow-wrap:anywhere;box-sizing:border-box}
.main-page140 .top>[data-action=help]{grid-column:3;grid-row:1;align-self:center;justify-self:end;min-width:44px;min-height:44px;margin:8px 0}
.main-page140.calendar-page138 main{padding-top:10px}
.page-add-row140{display:flex;justify-content:flex-end;margin:0 0 20px}
.page-add-row140 button{max-width:100%}
.directory-search138>button{width:auto;flex:none}
.directory-search138>label{min-width:0}
.directory-search138 input{box-sizing:border-box;width:100%;min-width:0}
.period-row label{min-width:0;flex:1}
.period-row select{width:auto;max-width:48%;flex:none}
.variant-pending140{outline:2px solid var(--green,#205c53);outline-offset:6px;scroll-margin-top:110px}
.variant-guide-status140{display:block;margin-bottom:8px}
.part-selection-list140{max-height:min(40dvh,320px);overflow:auto;overscroll-behavior:contain;border-block:1px solid var(--border);padding:6px 0;min-width:0;touch-action:pan-y}
.part-selection-list140 [hidden]{display:none!important}
.part-selection-search140{margin:8px 0!important}
.part-selection140 .piece-inline-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.part-selection140 .piece-inline-actions{position:sticky;bottom:0;z-index:2;padding-block:8px;background:#f8faf6}
#piece-inline-form.part-selection140{display:block;width:100%;min-width:0}
.part-selection140 .piece-inline-actions{width:100%}
#piece-inline-form.part-selection140 .part-selection-list140{padding-bottom:72px}
.part-selection140 .piece-inline-actions button{width:auto;min-height:44px;flex:0 0 auto;min-width:max-content;padding:8px 12px;height:auto}
.part-selection140 .piece-inline-actions .primary{background:var(--green,#205c53);color:white}
.part-selection-count140{margin:8px 0}
.part-selection-collapsed140>.part-selection-search140,.part-selection-collapsed140>.part-selection-list140{display:none}
.part-selection-list140 .check-row{min-width:0;margin:4px 0}
.part-selection-list140 .check-row input{flex:none}
.part-selection-list140 .check-row{overflow-wrap:anywhere}
.part-selection-row140{padding:3px 0}
.main-page140 main [id],.main-page140 main .field{scroll-margin-top:100px}
dialog{max-height:min(calc(100dvh - 24px),var(--dialog-visible-height140,100dvh));}
@media(max-width:480px){.main-menu-row140,.main-page140 .top{padding-inline:18px}}
.wide .main-menu-row140,.wide .main-page140 .top{padding-inline:32px}

/* Menu identity shared by ordinary pages and standalone Help/Support. */
.menu-button{position:relative;overflow:hidden;background:#fff!important;color:#1d5a51!important;border:1px solid #ccd8ce!important;border-radius:12px}
.menu-button::before{content:"";position:absolute;inset:0 auto 0 0;width:5px;background:#1d5a51;pointer-events:none}
.menu-button:focus-visible{outline:3px solid #1d5a51;outline-offset:3px}
.menu-button:hover{background:#f4f8f3!important}

