#app header {
  height: 68px;
  gap: 1.5rem;
  padding: 0 2rem;
}

#app .brand {
  white-space: nowrap;
}

#app .brand strong {
  display: block;
  font: 600 1.28rem Georgia, serif;
}

#app .header-actions {
  justify-content: flex-end;
  min-width: 0;
}

.header-button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 0 .9rem;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.header-button:hover {
  border-color: #9aaba2;
  background: #fffefa;
}

.header-button.active {
  border-color: #be826c;
  background: #fff6f1;
}

.header-button.ready {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

#app .search-wrap {
  width: min(340px, 34vw);
}

#app .search-wrap input {
  height: 38px;
}

#app .workspace {
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  padding: 1.25rem;
}

#app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

#app .stage {
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}

#app dialog,
#app dialog form,
#access-dialog .access-shell {
  touch-action: auto;
  overscroll-behavior: contain;
}

#auth .auth-card {
  padding: 2.5rem 3rem 2.25rem;
}

#auth .auth-card h1 {
  margin: 0 0 2rem;
}

@media (max-width: 650px) {
  #app header {
    height: auto;
    min-height: 112px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: .65rem;
    padding: .85rem 1rem;
  }

  #app .brand {
    padding-top: .45rem;
  }

  #app .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: 2;
  }

  #app .search-wrap {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .header-button {
    padding: 0 .7rem;
    min-width: 0;
  }

  #app .workspace {
    height: calc(100vh - 112px);
    height: calc(100dvh - 112px);
    padding: 0;
  }

  #app .stage {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  #app .zoom {
    right: 1rem;
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
}
