/* Cuts off the top bar's background at the edges of the page's column, without scrolling sideways */
.app-main {
  min-width: 0;
  overflow-x: clip;
}

/* Fills the page's column. Text and forms keep to a width that's easy to read, beside the nav, unless the page is wide
   or fills the screen */
.container {
  width: 100%;
  padding: var(--space-4) calc(var(--space-4) + env(safe-area-inset-right)) var(--space-6) calc(var(--space-4) + env(safe-area-inset-left));
  overflow-wrap: break-word;

  &:not(.wide, .full-screen) > :not(.top-bar) {
    max-width: var(--content-max-width);
  }

  /* The top bar starts at the top of the page */
  &:has(.top-bar) {
    padding-top: 0;
  }

  @media (min-width: 800px) {
    padding-right: calc(var(--space-5) + env(safe-area-inset-right));
    padding-left: var(--space-5);
  }
}

/* A section's heading with its actions beside it, wrapping below on narrow screens. Spaced like a heading on its own,
   since a flex container's margins don't merge with its children's */
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0;

  > :is(h2, h3) {
    margin: 0;
  }
}

/* A row of buttons, wrapping when there's no room */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.vert-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Instructions to follow in order */
.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-4) 0;
  padding-left: var(--space-5);
}

/* Only in the app that was added to a home screen, not in a browser */
.home-screen-only {
  display: none;
  margin-top: var(--space-4);

  @media (display-mode: standalone) {
    display: flex;
  }
}

.meta {
  color: var(--meta-text-color);
  font-size: var(--fs-small);
}

.empty-state {
  margin: var(--space-6) 0;
  color: var(--meta-text-color);
  text-align: center;
}
