.title {
  color: var(--pico-contrast);
  text-decoration: none;
  white-space: nowrap;
}

.title-short {
  display: none;
}

@media (max-width: 480px) {
  .title-long {
    display: none;
  }

  .title-short {
    display: inline;
  }
}

nav select {
  margin-bottom: 0;
  width: auto;
}

textarea {
  flex: none;
  font-family: var(--pico-font-family-monospace);
  max-height: 40vh;
  max-height: 40dvh;
  min-height: 10rem;
  resize: none;
}

#message:empty {
  display: none;
}

#message.error {
  color: var(--pico-del-color);
}

/* Fill exactly the viewport: the text field takes what it needs (up to
   40%, then it scrolls), the QR code gets the rest, centred */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

figure {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  min-height: 10rem;
}

#qrcode {
  cursor: pointer;
  display: block;
  flex: 0 1 auto;
  image-rendering: pixelated;
  max-width: 100%;
  min-height: 0;
  object-fit: contain;
}

/* Usage hint only on touch devices, desktops get the tooltip */
figcaption {
  display: none;
  flex: none;
  font-size: 0.875em;
  padding-top: 0.75rem;
}

@media (hover: none) and (pointer: coarse) {
  #qrcode:not([hidden]) + figcaption {
    display: block;
  }
}
