html:has(#menu-viewer[open]) { overflow:hidden }
#menu-viewer {
  margin:auto; padding:0; width:100%; height:100vh; height:100dvh;
  max-width:none; max-height:none; border:0; background:var(--paper);
  color:var(--ink); font:inherit; overscroll-behavior:contain;
}
#menu-viewer[open] { display:grid; grid-template-rows:auto minmax(90px,1fr) auto }
#menu-viewer::backdrop { background:rgb(10 24 19 / 78%) }
#menu-viewer :focus-visible { outline:2px solid var(--rust); outline-offset:-3px }
.mv-header, #mv-controls, #mv-controls>div, #menu-viewer button, .mv-header a {
  display:flex; align-items:center; justify-content:center;
}
.mv-header { gap:.5rem; padding:calc(.45rem + env(safe-area-inset-top)) .5rem .45rem 1rem }
#mv-title { font-size:clamp(1.4rem,4vw,1.95rem); margin:.25rem auto 0 0 }
#menu-viewer svg {
  width:1.4rem; height:1.4rem; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round; fill:none;
}
#menu-viewer button, .mv-header a {
  flex-shrink:0; min-width:44px; min-height:44px; border-radius:6px;
  touch-action:manipulation;
}
.mv-header a { color:var(--rust); gap:.45rem; font-size:1rem; font-weight:500 }
@media (max-width:26rem) { .mv-header a span { display:none } }
#menu-viewer button[aria-disabled=true] { opacity:.34; cursor:default }
#menu-viewer button:not([aria-disabled=true]):hover, .mv-header a:hover { background:rgb(44 72 53 / 9%) }
#mv-sheet {
  min-width:0; position:relative; overflow:auto; overscroll-behavior:contain;
  background:#d8d9d4;
}
#mv-paper {
  display:grid; place-content:center; padding:7px;
  width:max-content; min-width:100%; min-height:100%;
}
#mv-paper:empty { display:none }
#mv-paper canvas { display:block; box-shadow:0 2px 6px rgb(23 32 25 / 24%) }
#mv-status { margin:auto; padding:2rem 1rem; color:var(--ink); text-align:center }
#mv-controls {
  flex-wrap:wrap; gap:0 clamp(.5rem,2vw,1.5rem); font-variant-numeric:tabular-nums;
  padding:.35rem .2rem calc(.35rem + env(safe-area-inset-bottom));
}
#mv-controls>div + div { border-left:1px solid var(--line); padding-left:clamp(.5rem,2vw,1.5rem) }
#mv-index, #menu-viewer #mv-zoom { display:inline-block; min-width:3.35rem; text-align:center }
.mv-sr {
  position:absolute; top:0; left:0; width:1px; height:1px; overflow:hidden;
  clip-path:inset(50%); white-space:nowrap;
}
@media (min-width:50rem) and (min-height:35rem) {
  #menu-viewer { width:min(94%,66rem); height:94vh; height:94dvh; border-radius:10px }
  .mv-header { gap:1rem; padding:.5rem 1rem .5rem 1.5rem }
}
