body {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--footer-height);
  overflow-x: hidden;
}

.workspace {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex: 1 0 auto;
  width: 100%;
  min-height: calc(100vh - var(--footer-height) - 3rem);
}

.menu-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-strip {
  display: none;
}

.menu {
  flex: 0 0 var(--menu-width);
  width: var(--menu-width);
  max-width: var(--menu-width);
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
  background-color: var(--bg);
}

/*
  Menu panel is 80% of (30ch plus horizontal padding). Collapse when that
  panel would occupy more than 40% of the page: (24ch + 1.6rem) / 0.4.
*/
@media (min-width: calc(60ch + 4rem + 1px)) {
  .menu-toggle {
    display: none;
  }
}

@media (max-width: calc(60ch + 4rem)) {
  .menu-strip {
    display: flex;
    flex: 0 0 2rem;
    width: 2rem;
    min-height: 14rem;
  }

  .workspace::before {
    width: 2rem;
  }

  .menu {
    display: none;
    flex: none;
    width: auto;
    max-width: none;
  }

  .menu-toggle:checked ~ .menu {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: var(--footer-height);
    left: 0;
    z-index: 20;
    overflow: auto;
    background-color: var(--bg);
  }

  .menu-toggle:checked ~ .menu-strip {
    position: fixed;
    top: 0.7rem;
    right: 0.7rem;
    left: auto;
    z-index: 30;
    width: 4.5rem;
    min-height: 0;
    height: 2.2rem;
    flex-basis: auto;
  }
}
